Add limit and offset.

pull/778/head
Andrey 2023-05-02 15:04:46 +03:00
rodzic aa0f2458d7
commit 9f2051688a
1 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -238,7 +238,11 @@ async def delete_subscription_handler(request: Request, subscription_id: str):
@router.get("/", tags=["subscriptions"], response_model=data.SubscriptionsListResponse) @router.get("/", tags=["subscriptions"], response_model=data.SubscriptionsListResponse)
async def get_subscriptions_handler(request: Request) -> data.SubscriptionsListResponse: async def get_subscriptions_handler(
request: Request,
limit: Optional[int] = 10,
offset: Optional[int] = 0,
) -> data.SubscriptionsListResponse:
""" """
Get user's subscriptions. Get user's subscriptions.
""" """
@ -255,7 +259,8 @@ async def get_subscriptions_handler(request: Request) -> data.SubscriptionsListR
token=token, token=token,
collection_id=collection_id, collection_id=collection_id,
required_field=[f"type:subscription"], required_field=[f"type:subscription"],
limit=1000, limit=limit,
offset=offset,
) )
# resources: BugoutResources = bc.list_resources(token=token, params=params) # resources: BugoutResources = bc.list_resources(token=token, params=params)