Skip to content

Commit 19fa728

Browse files
Merge pull request #57 from GeneralMagicio/add-isActive-false
added check for is Active to be false
2 parents ccf0fd0 + 958507c commit 19fa728

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/poll/Poll.dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export class GetPollsDto {
5353
worldID?: string;
5454

5555
@IsOptional()
56+
@Type(() => Number)
5657
@IsInt()
5758
@Min(1)
5859
page?: number = 1;

src/poll/poll.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ export class PollService {
8585
filters.endDate = { gt: now };
8686
}
8787

88+
if (isActive === false) {
89+
filters.OR = [{ startDate: { gt: now } }, { endDate: { lte: now } }];
90+
}
8891
if ((userCreated || userVoted) && query.worldID) {
8992
const user = await this.databaseService.user.findUnique({
9093
where: { worldID: query.worldID },

0 commit comments

Comments
 (0)