nestjsx / crud

NestJs CRUD for RESTful APIs
https://github.com/nestjsx/crud/wiki
MIT License
4.04k stars 533 forks source link

Is it possible to enable the default query parameters in custom routes? #716

Open oscardianno opened 3 years ago

oscardianno commented 3 years ago

I want to write a custom route with a custom function, and enable the default parameters just as nestjsx would do.

In the past, I did override a route to provide a custom function:

@Override('getManyBase')
  @ApiOperation({
    summary: 'Get all notifications of the user logged in',
  })
  async getAllUserNotifications(@ParsedRequest() parsedRequest: CrudRequest) {
    return this.service.getUserNotifications(parsedRequest);
  }

And that brought me the parameters in the documentation just as I needed: image

However, this time I can't override the default route (because I need it), but I want to create another route and also use the default parameters, yet I haven't found a way to re-use them. Is it possible?

avalero85 commented 2 years ago

I have the same question. In the documentation it is not clear if we can extend this functionality to our custom methods.

Does anyone know if this is possible?

Thanks in advance.