fix: name, update values HTTPException
This commit is contained in:
@@ -9,6 +9,7 @@ from fastapi import (
|
||||
status,
|
||||
)
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from fastapi_jwt_auth import AuthJWT
|
||||
|
||||
@@ -23,7 +24,8 @@ from api.schemas.endpoints.account import UserUpdate
|
||||
|
||||
from api.services.access_token_validadtion import AccessTokenValidadtion
|
||||
from api.services.user_role_validation import db_user_role_validation
|
||||
from api.services.update_data_validation import put_user_data_validator
|
||||
from api.services.update_data_validation import put_user_data_changes
|
||||
|
||||
|
||||
api_router = APIRouter(
|
||||
prefix="/account",
|
||||
@@ -96,12 +98,10 @@ async def put_account(
|
||||
detail="Account not found")
|
||||
|
||||
|
||||
update_values = put_user_data_validator(user_update,user)
|
||||
update_values = put_user_data_changes(user_update,user)
|
||||
|
||||
if update_values is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_409_CONFLICT,
|
||||
detail="The provided data already exists in the database")
|
||||
return user
|
||||
|
||||
await put_user_id(connection, update_values, user)
|
||||
|
||||
@@ -130,12 +130,11 @@ async def delete_account(
|
||||
|
||||
user_update = UserUpdate(status=Status.DELETED.value)
|
||||
|
||||
update_values = put_user_id_validator(user_update,user)
|
||||
update_values = put_user_data_changes(user_update,user)
|
||||
|
||||
if update_values is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_409_CONFLICT,
|
||||
detail="The provided data already exists in the database")
|
||||
return user
|
||||
|
||||
|
||||
await put_user_id(connection, update_values, user)
|
||||
|
||||
|
Reference in New Issue
Block a user