mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-11-02 12:21:53 +08:00
return empty response with 204 (#650)
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
from typing import Any, Callable, Dict, Optional, Type, cast
|
from typing import Any, Callable, Dict, Optional, Type, cast
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Request, status
|
from fastapi import APIRouter, Depends, HTTPException, Request, status, Response
|
||||||
from pydantic import UUID4
|
from pydantic import UUID4
|
||||||
|
|
||||||
from fastapi_users import models
|
from fastapi_users import models
|
||||||
@ -138,6 +138,7 @@ def get_users_router(
|
|||||||
@router.delete(
|
@router.delete(
|
||||||
"/{id:uuid}",
|
"/{id:uuid}",
|
||||||
status_code=status.HTTP_204_NO_CONTENT,
|
status_code=status.HTTP_204_NO_CONTENT,
|
||||||
|
response_class=Response,
|
||||||
dependencies=[Depends(get_current_superuser)],
|
dependencies=[Depends(get_current_superuser)],
|
||||||
)
|
)
|
||||||
async def delete_user(id: UUID4):
|
async def delete_user(id: UUID4):
|
||||||
|
|||||||
Reference in New Issue
Block a user