We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 72ca002 + 167f65e commit 0c29626Copy full SHA for 0c29626
app.py
@@ -1,6 +1,6 @@
1
import os
2
from fastapi import FastAPI, Body, HTTPException, status
3
-from fastapi.responses import JSONResponse
+from fastapi.responses import Response, JSONResponse
4
from fastapi.encoders import jsonable_encoder
5
from pydantic import BaseModel, Field, EmailStr
6
from bson import ObjectId
@@ -118,6 +118,6 @@ async def delete_student(id: str):
118
delete_result = await db["students"].delete_one({"_id": id})
119
120
if delete_result.deleted_count == 1:
121
- return JSONResponse(status_code=status.HTTP_204_NO_CONTENT)
+ return Response(status_code=status.HTTP_204_NO_CONTENT)
122
123
raise HTTPException(status_code=404, detail=f"Student {id} not found")
0 commit comments