diff --git a/src/user/user.dto.ts b/src/user/user.dto.ts index 066baad..7f95fe2 100644 --- a/src/user/user.dto.ts +++ b/src/user/user.dto.ts @@ -88,6 +88,9 @@ export class UserActionDto { @IsString() pollDescription: string + @IsDateString() + startDate: string + @IsDateString() endDate: string diff --git a/src/user/user.service.ts b/src/user/user.service.ts index 11092e8..fc4d3d0 100644 --- a/src/user/user.service.ts +++ b/src/user/user.service.ts @@ -205,6 +205,7 @@ export class UserService { title: true, description: true, isAnonymous: true, + startDate: true, endDate: true, authorUserId: true, participantCount: true, @@ -242,6 +243,9 @@ export class UserService { pollTitle: action.poll.title || '', isAnonymous: action.poll.isAnonymous, pollDescription: action.poll.description ?? '', + startDate: action.poll.startDate + ? action.poll.startDate.toISOString() + : '', endDate: action.poll.endDate ? action.poll.endDate.toISOString() : '', isActive: action.poll.endDate ? action.poll.endDate >= now : false, votersParticipated: action.poll.participantCount,