From 5522471c181c2748d9d5ae0c87bbbd8afb751f79 Mon Sep 17 00:00:00 2001 From: Ramin Date: Tue, 3 Jun 2025 18:45:04 +0330 Subject: [PATCH] add startDate to actions --- src/user/user.dto.ts | 3 +++ src/user/user.service.ts | 4 ++++ 2 files changed, 7 insertions(+) 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,