Spaces:
Sleeping
Sleeping
Update src/services/interview_history_router.py
Browse files
src/services/interview_history_router.py
CHANGED
|
@@ -48,6 +48,11 @@ async def get_interview_history_by_id(history_id: str, db: AsyncIOMotorDatabase
|
|
| 48 |
history = await InterviewHistoryModel.get(db, InterviewHistoryModel.collection_name, {"_id": ObjectId(history_id)})
|
| 49 |
if history is None:
|
| 50 |
raise HTTPException(status_code=404, detail="Interview history not found")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
return history
|
| 52 |
|
| 53 |
@router.put("/interview-histories/{history_id}", response_model=InterviewHistoryResponse)
|
|
|
|
| 48 |
history = await InterviewHistoryModel.get(db, InterviewHistoryModel.collection_name, {"_id": ObjectId(history_id)})
|
| 49 |
if history is None:
|
| 50 |
raise HTTPException(status_code=404, detail="Interview history not found")
|
| 51 |
+
|
| 52 |
+
# Convert ObjectId to string to satisfy Pydantic response model
|
| 53 |
+
if "_id" in history:
|
| 54 |
+
history["_id"] = str(history["_id"])
|
| 55 |
+
|
| 56 |
return history
|
| 57 |
|
| 58 |
@router.put("/interview-histories/{history_id}", response_model=InterviewHistoryResponse)
|