Fix rerouted POST
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 14s

This commit is contained in:
Nexus 2024-06-06 00:50:23 +01:00
parent 854abd9a6b
commit 1c1821b17a
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -109,9 +109,9 @@ def head_truth(truth_id: str, db: redis.Redis = Depends(get_db_factory())):
return Response()
@truth_router.post("/", status_code=201)
def post_truth(payload: TruthPayload, response: JSONResponse, db: redis.Redis = Depends(get_db_factory())):
"""Stores a new truth"""
@truth_router.post("", status_code=201)
def new_truth(payload: TruthPayload, response: JSONResponse, db: redis.Redis = Depends(get_db_factory())):
"""Creates a new truth"""
data = payload.model_dump()
existing: str = db.get(data["id"])
if existing: