Return 204 on empty success responses (not 200)
This commit is contained in:
parent
5ff4da15d8
commit
d106423fca
|
@ -123,4 +123,4 @@ async def logout(cur_token: RefreshTokenDep) -> Response:
|
|||
cur_db_token.revoked = True
|
||||
_ = await cur_db_token.replace()
|
||||
|
||||
return Response(status_code=status.HTTP_200_OK)
|
||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
||||
|
|
|
@ -157,7 +157,7 @@ async def delete_category(category_id: PydanticObjectId, user: CurrentUserDep) -
|
|||
# We can now safely delete the category
|
||||
_ = await category.delete()
|
||||
|
||||
return Response(status_code=status.HTTP_200_OK)
|
||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
@categories_router.post("")
|
||||
|
|
|
@ -4,7 +4,7 @@ from typing import Annotated, final
|
|||
from beanie import PydanticObjectId
|
||||
from fastapi import APIRouter, Body, HTTPException, Response, status
|
||||
from pydantic import BaseModel, EmailStr, StringConstraints
|
||||
from starlette.status import HTTP_200_OK
|
||||
from starlette.status import HTTP_204_NO_CONTENT
|
||||
|
||||
from src.api.auth.dependencies import LoggedInDep
|
||||
from src.api.auth.passwords import check_hashed_password, create_password_hash
|
||||
|
@ -134,7 +134,7 @@ async def delete_user(user_id: PydanticObjectId, user: CurrentUserDep) -> Respon
|
|||
|
||||
_ = await user.delete()
|
||||
|
||||
return Response(status_code=HTTP_200_OK)
|
||||
return Response(status_code=HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
@protected_router.patch("/{user_id}")
|
||||
|
|
Loading…
Reference in a new issue