Open renatosantos0611 opened 7 months ago
Please take a look at the README: https://github.com/ppetzold/nestjs-paginate?tab=readme-ov-file#code
In there you can see that there are 2 steps:
@Paginate() query: PaginateQuery
parameter decorator.paginate
function, passing it the query, repository, and pagination configuration.Your code does not seem to have these steps implemented properly. Feel free to ask more questions! :)
Please take a look at the README: https://github.com/ppetzold/nestjs-paginate?tab=readme-ov-file#code
In there you can see that there are 2 steps:
- In the controller, you MUST apply the
@Paginate() query: PaginateQuery
parameter decorator.- You MUST use the
paginate
function, passing it the query, repository, and pagination configuration.Your code does not seem to have these steps implemented properly. Feel free to ask more questions! :)
I think you didn't understand the problem or maybe I didn't convey it clearly, I use this lib in all my projects and works good, but you can try it yourself or use my example, you need only to create a Module containing controllers without using this lib, and make that Module import first in your main Module, and see every controllers of your entire application that don't use this lib stopping work.
Ok, could you show your example as a complete minimal reproducible example? I'll link an explanation on MREs https://stackoverflow.com/help/minimal-reproducible-example
In its current form I can't tell what you mean from the code, and a text description of code is hard to follow 😅
you need only to create a Module containing controllers without using this lib, and make that Module import first in your main Module, and see every controllers of your entire application that don't use this lib stopping work.
Could you do this for me and share a link to the repository, so that I can execute the code and see it in action? Thanks!
I don't know if nestjs-paginate should work like this, but all controllers of any Module that don't have any Paginate decorators give undefined value in nestjs decorators like @Body, @Param, @Query and @Req ... when import first than Module that have Paginate decorators, I create a simple example of that
in a app.module.ts
WithoutPaginateModule imports first than WithPaginateModule, so all nestjs decorators from WithoutPaginateModule controllers get undefined value, importing WithPaginateModule first, everything works. Should the sequence of imports really matter? Did I forget something?
here example https://github.com/renatosantos0611/nestjs-paginate-query-issue
Thanks for help ;D