Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reuse queries in 3.x? #45

Closed
Diluka opened this issue Mar 25, 2019 · 0 comments
Closed

How to reuse queries in 3.x? #45

Diluka opened this issue Mar 25, 2019 · 0 comments

Comments

@Diluka
Copy link
Contributor

Diluka commented Mar 25, 2019

@zMotivat0r In my projects, it's often export file. And it shall be equivalent to table query. So I reuse getMany method.
Do you have better solution?

this is 2.1.0 version

  @ApiProduces(mime.getType('.xlsx'))
  @UseInterceptors(RestfulQueryInterceptor)
  @Get('/export/list.xlsx')
  async export(@Res() res: any, @Param() params: ObjectLiteral, @Query() query: RestfulParamsDto) {

    delete query.page;
    delete query.limit;

    const list = await this.base.getManyBase(params, query);
    // do something e.g. generate an excel file
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants