refactor: use TimeOptions for Listens report

This commit is contained in:
Julian Tölle 2020-07-12 17:17:50 +02:00
parent 5bc76f23d0
commit 67ea28aec7
7 changed files with 51 additions and 59 deletions

View file

@ -1,6 +1,7 @@
import { IsEnum, IsISO8601 } from "class-validator";
import { IsEnum, ValidateNested } from "class-validator";
import { User } from "../../users/user.entity";
import { Timeframe } from "../timeframe.enum";
import { ReportTimeDto } from "./report-time.dto";
export class GetListenReportDto {
user: User;
@ -8,9 +9,6 @@ export class GetListenReportDto {
@IsEnum(Timeframe)
timeFrame: Timeframe;
@IsISO8601()
timeStart: string;
@IsISO8601()
timeEnd: string;
@ValidateNested()
time: ReportTimeDto;
}

View file

@ -5,10 +5,4 @@ export class ListenReportDto {
date: string;
count: number;
}[];
timeFrame: Timeframe;
timeStart: string;
timeEnd: string;
}