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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user