From bb74f05610751dd9d32185cab588e941caca20be Mon Sep 17 00:00:00 2001 From: BatuhanIlhan Date: Mon, 25 Dec 2023 01:57:14 +0300 Subject: [PATCH] be/fix_poll-id --- app/backend/src/poll/poll.module.ts | 1 - app/backend/src/poll/poll.service.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/backend/src/poll/poll.module.ts b/app/backend/src/poll/poll.module.ts index ff85aac1..12c306e9 100644 --- a/app/backend/src/poll/poll.module.ts +++ b/app/backend/src/poll/poll.module.ts @@ -71,7 +71,6 @@ export class PollModule implements NestModule { .forRoutes( { path: '/poll', method: RequestMethod.GET }, { path: '/poll/:param', method: RequestMethod.GET }, - { path: '/poll/:id', method: RequestMethod.GET }, ); } } diff --git a/app/backend/src/poll/poll.service.ts b/app/backend/src/poll/poll.service.ts index 39b3b438..1bcdad9d 100644 --- a/app/backend/src/poll/poll.service.ts +++ b/app/backend/src/poll/poll.service.ts @@ -560,7 +560,7 @@ export class PollService { const votedOption = userId ? (await this.voteService.findOne(poll.id, userId))?.option || null : null; let voteDistribution = null; - if (votedOption) { + if (votedOption || poll.is_settled === Settle.SETTLED) { voteDistribution = await this.voteService.getVoteRate(pollId); }