fix get_case
This commit is contained in:
@ -58,7 +58,8 @@ class CaseService:
|
|||||||
]
|
]
|
||||||
|
|
||||||
async def get_case(self, case_id: str):
|
async def get_case(self, case_id: str):
|
||||||
case = await cases_collection.find_one({"id": case_id})
|
# проекция {"_id": 0} говорит Mongo не возвращать поле _id
|
||||||
|
case = await cases_collection.find_one({"id": case_id}, {"_id": 0})
|
||||||
if not case:
|
if not case:
|
||||||
raise HTTPException(status_code=404, detail="Кейс не найден")
|
raise HTTPException(status_code=404, detail="Кейс не найден")
|
||||||
return case
|
return case
|
||||||
|
|||||||
Reference in New Issue
Block a user