Open Lyokolux opened 1 year ago
L'implémentation actuelle de la pagination s'utilise come suit:
@Get() @ApiPaginatedResponse(GetSiteDto) async findAll( @Req() req: Request, @Query('items', ItemsQueryPipe) items: number, @Query('page', PageQueryPipe) page: number, ): Promise<PaginatedData<Site>> { // ... actions return createPaginationData<Site>({ url: getEndpoint(req), items: sites, queryOptions: { items, page }, totalItemCount }) }
As developer, it would be more maintainable to use the pagination as follow in the controllers:
@Get() @ApiPaginatedEndpoint(...metadataForPagination) async findAll( pagination: Pagination ): Promise<PaginatedData<Site>> { // ... actions return createPaginationData({ data, totalItemCount ...pagination }) }
Thus the decorator provides the url and the queryOptions objects inside a pagination object.
url
queryOptions
At least one findAll controller use the pagination recommended.
Description
L'implémentation actuelle de la pagination s'utilise come suit:
As developer, it would be more maintainable to use the pagination as follow in the controllers:
Thus the decorator provides the
url
and thequeryOptions
objects inside a pagination object.DoD
At least one findAll controller use the pagination recommended.