Skip to content

Commit

Permalink
fix AnnouncementService
Browse files Browse the repository at this point in the history
  • Loading branch information
riku6460 committed Sep 27, 2023
1 parent 56a817b commit 8d35299
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/backend/src/core/AnnouncementService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class AnnouncementService {
);
query.select([
'announcement.*',
'CASE WHEN read.id IS NULL THEN FALSE ELSE TRUE END as "isRead"',
'read.id IS NOT NULL as "isRead"',
]);
query
.andWhere(
Expand Down Expand Up @@ -115,10 +115,6 @@ export class AnnouncementService {
'read."announcementId" = announcement.id AND read."userId" = :userId',
{ userId: user.id },
);
query.select([
'announcement.*',
'CASE WHEN read.id IS NULL THEN FALSE ELSE TRUE END as "isRead"',
]);
query.andWhere('read.id IS NULL');
query.andWhere('announcement."isActive" = true');

Expand Down

0 comments on commit 8d35299

Please sign in to comment.