feat: download product report
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 8s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 8s
This commit is contained in:
parent
64884875b3
commit
d6f7c34331
1 changed files with 13 additions and 0 deletions
|
|
@ -167,6 +167,19 @@ export class StatsController extends Controller {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("receipt/download")
|
||||||
|
async downloadProductReport(
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
|
@Query() limit?: number,
|
||||||
|
@Query() startDate?: Date,
|
||||||
|
@Query() endDate?: Date,
|
||||||
|
) {
|
||||||
|
this.setHeader("Content-Type", "text/csv");
|
||||||
|
return json2csv(await this.productReport(req, limit, startDate, endDate), {
|
||||||
|
useDateIso8601Format: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Get("product")
|
@Get("product")
|
||||||
async productReport(
|
async productReport(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue