Skip to content

Commit 5a69072

Browse files
Merge pull request #42 from GeneralMagicio/check-type
check explicitly if true
2 parents 91b6aee + ca50672 commit 5a69072

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/poll/poll.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ export class PollService {
7878
const skip = (page - 1) * limit;
7979
const now = new Date();
8080
const filters: any = {};
81-
if (isActive) {
81+
if (isActive === true) {
8282
filters.startDate = { lte: now };
8383
filters.endDate = { gt: now };
8484
}
85-
if (userCreated) {
85+
if (userCreated === true) {
8686
filters.authorUserId = userId;
8787
}
8888

8989
// Get polls user voted in
9090
let votedPollIds: number[] = [];
91-
if (userVoted) {
91+
if (userVoted === true) {
9292
const userVotes = await this.databaseService.vote.findMany({
9393
where: { userId },
9494
select: { pollId: true },

0 commit comments

Comments
 (0)