fix(server): validate listens report query params

When using Omit<>, class-validator can not see the decorators of the base
type and skips validation.
This commit is contained in:
Julian Tölle 2020-06-01 20:19:44 +02:00
parent 40ce26eadd
commit 6f8fc0265a

View file

@ -13,7 +13,7 @@ export class ReportsController {
@Get("listens") @Get("listens")
@Auth() @Auth()
async getListens( async getListens(
@Query() options: Omit<GetListenReportDto, "user">, @Query() options: GetListenReportDto,
@ReqUser() user: User @ReqUser() user: User
): Promise<ListenReportDto> { ): Promise<ListenReportDto> {
return this.reportsService.getListens({ ...options, user }); return this.reportsService.getListens({ ...options, user });