Allow getting non-rich truth lists
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 13s
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 13s
This commit is contained in:
parent
65acd62d12
commit
d6ee4a3639
1 changed files with 3 additions and 1 deletions
|
@ -58,9 +58,11 @@ app = FastAPI(
|
|||
|
||||
|
||||
@app.get("/api/truths/all")
|
||||
def get_all_truths(db: redis.Redis = Depends(get_db)):
|
||||
def get_all_truths(rich: bool = True, db: redis.Redis = Depends(get_db)):
|
||||
"""Retrieves all stored truths"""
|
||||
keys = db.keys()
|
||||
if rich is False:
|
||||
return keys
|
||||
truths = [json.loads(db.get(key)) for key in keys]
|
||||
return truths
|
||||
|
||||
|
|
Loading…
Reference in a new issue