fix endpoint search #21
@ -42,7 +42,7 @@ async def read_events(authorize: Annotated[bool, Depends(permissions_checker.Per
|
|||||||
|
|
||||||
|
|
||||||
@router.get("/events/search", tags=["events"], response_model=list[events.EventOut])
|
@router.get("/events/search", tags=["events"], response_model=list[events.EventOut])
|
||||||
async def search_events(authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin", "User"]))], skip: int = 0, limit: int = 20, item: str | None = None, status: int | None = None):
|
async def search_events(authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin", "User"]))], skip: int = 0, limit: int = 20, item: str | None = None, status: int = 1):
|
||||||
if limit < 1 or skip < 0 or limit < skip:
|
if limit < 1 or skip < 0 or limit < skip:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_400_BAD_REQUEST,
|
status_code=status.HTTP_400_BAD_REQUEST,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user