nestjsx / nestjs-typeorm-paginate

:page_with_curl: Pagination response object function + types for typeorm + nestjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation of paginationType options is not in line with code

petervizi opened this issue · comments

Documentation of the paginationType options says it defaults to take/skip

/**
* Used for changing query method to limit/offset (defaults to take/skip if no argument supplied)
*/
paginationType?: PaginationTypeEnum;

however actual code does the opposite

const paginationType =
options.paginationType || PaginationTypeEnum.LIMIT_AND_OFFSET;

IMHO proper fix should be to indeed default to PaginationTypeEnum.TAKE_AND_SKIP however that's a breaking change so will leave next steps to code owners.

Thanks for pointing this out! I have corrected this part of the docs. Not sure if there are any others? I'm still not sure on the LIMIT/OFFSET vs TAKE/SKIP I think I'll have to do a poll at some point to see what the majority votes are. There's only ever been a few arguments/suggestions/requests for take/skip so now I've added it we'll see!