Skip to content

Commit

Permalink
Hotfix status: rollback, return status field in get users endpoint (#26)
Browse files Browse the repository at this point in the history
rollback, return status field in get users endpoint
  • Loading branch information
violetaperezandrade authored May 31, 2024
1 parent 4134552 commit dd7c80d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/controller/Users.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fastapi import status, Response
from fastapi import status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import JSONResponse
from external.Social import SocialService
Expand All @@ -25,9 +25,17 @@ def handle_get_users(self, query_params: dict):
return JSONResponse(
status_code=status.HTTP_200_OK,
content=jsonable_encoder({
"message": users})
"message": users,
"status": status.HTTP_200_OK,
})
)
return JSONResponse(
status_code=status.HTTP_204_OK,
content=jsonable_encoder({
"message": "no users found",
"status": status.HTTP_204_OK,
})
)
return Response(status_code=status.HTTP_204_NO_CONTENT)

async def handle_create_user(self, user_data: dict):
result = self.users_service.create_user(user_data)
Expand Down

0 comments on commit dd7c80d

Please sign in to comment.