1
0
mirror of https://github.com/ltcptgeneral/cs239-caching.git synced 2025-09-18 21:17:21 +00:00

add get user id endpoint (/users),

fix issue in tiered cache,
update basic test with new user id set
This commit is contained in:
Arthur Lu
2025-02-21 19:39:09 +00:00
committed by root
parent dd5fc9f83c
commit dee97f09c2
4 changed files with 14 additions and 3 deletions

@@ -8,6 +8,9 @@ DB_LOCATION = "database/datastore/" + DB_FILE
db = TinyDB(DB_LOCATION)
User = Query()
def get_user_ids():
return [x["user_id"] for x in db.all()]
def get_user_profile(user_id):
"""Fetch user profile from TinyDB"""
result = db.search(User.user_id == user_id)