Skip to content

Commit

Permalink
removed response models from places not required
Browse files Browse the repository at this point in the history
  • Loading branch information
deepansh96 committed Mar 29, 2023
1 parent 8186ae4 commit 9191748
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ class Config:
schema_extra = {"example": {"answer": [0, 1, 2], "visited": True}}


"""
Note : The below model is not being used currently anywhere
"""


class SessionAnswerResponse(SessionAnswer):
"""Model for the response of any request that returns a session answer"""

Expand Down
8 changes: 4 additions & 4 deletions app/routers/session_answers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from fastapi.responses import JSONResponse
from fastapi.encoders import jsonable_encoder
from database import client
from models import SessionAnswerResponse, UpdateSessionAnswer
from models import UpdateSessionAnswer
from utils import remove_optional_unset_args

router = APIRouter(prefix="/session_answers", tags=["Session Answers"])


@router.patch("/{session_id}/{position_index}", response_model=SessionAnswerResponse)
@router.patch("/{session_id}/{position_index}", response_model=None)
async def update_session_answer_in_a_session(
session_id: str, position_index: int, session_answer: UpdateSessionAnswer
):
Expand Down Expand Up @@ -51,10 +51,10 @@ async def update_session_answer_in_a_session(
# update the document in the session_answers collection
client.quiz.sessions.update_one({"_id": session_id}, {"$set": setQuery})

return JSONResponse(status_code=status.HTTP_200_OK, content=session_answer)
return JSONResponse(status_code=status.HTTP_200_OK)


@router.get("/{session_id}/{position_index}", response_model=SessionAnswerResponse)
@router.get("/{session_id}/{position_index}", response_model=None)
async def get_session_answer_from_a_session(session_id: str, position_index: int):
pipeline = [
{
Expand Down

0 comments on commit 9191748

Please sign in to comment.