From 8d35299f623a5d82bb7bc97b522849dc6dc0b951 Mon Sep 17 00:00:00 2001 From: riku6460 <17585784+riku6460@users.noreply.github.com> Date: Thu, 28 Sep 2023 07:16:46 +0900 Subject: [PATCH] fix AnnouncementService --- packages/backend/src/core/AnnouncementService.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/backend/src/core/AnnouncementService.ts b/packages/backend/src/core/AnnouncementService.ts index b971498613..3c0432ca73 100644 --- a/packages/backend/src/core/AnnouncementService.ts +++ b/packages/backend/src/core/AnnouncementService.ts @@ -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( @@ -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');