From 304851b5ee6deda79f5e39d7047726c9460d0bcf Mon Sep 17 00:00:00 2001 From: HBLEEEEE Date: Mon, 2 Dec 2024 19:11:08 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[fix]=20=EC=9E=91=EB=AC=BC=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=EC=9C=BC=EB=A1=9C=20=EB=A6=AC=ED=84=B4=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=95=8C=EB=A6=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/backend/src/mail/mail.service.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/mail/mail.service.ts b/apps/backend/src/mail/mail.service.ts index 928ac50..0111152 100644 --- a/apps/backend/src/mail/mail.service.ts +++ b/apps/backend/src/mail/mail.service.ts @@ -183,8 +183,21 @@ export class MailService implements OnModuleInit, OnModuleDestroy { private async getActionParam(action: number, param1: Nullable) { if ([1, 2].includes(action)) { - const result = await this.databaseService.query(mailQueries.getCropName, [param1]); - return result.rows[0]?.crop_name || ''; + const cropId = (await this.databaseService.query(mailQueries.getCropName, [param1])).rows[0] + .crop_name; + + switch (cropId) { + case 1: + return '당근'; + case 2: + return '수박'; + case 3: + return '포도'; + case 4: + return '버섯'; + case 5: + return '사과'; + } } else if ([4, 5, 7].includes(action)) { const result = await this.databaseService.query(mailQueries.getMemberNickNameByMemberID, [ param1 From 8930c6f7094dcd298c961a9f4568d4a8ba267f3a Mon Sep 17 00:00:00 2001 From: HBLEEEEE Date: Mon, 2 Dec 2024 19:14:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[fix]=20=EC=95=8C=EB=A6=BC=20=EC=9E=91?= =?UTF-8?q?=EB=AC=BC=EB=AA=85=20=EB=A6=AC=ED=84=B4=EA=B0=92=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/backend/src/mail/mail.service.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/backend/src/mail/mail.service.ts b/apps/backend/src/mail/mail.service.ts index 0111152..2156c80 100644 --- a/apps/backend/src/mail/mail.service.ts +++ b/apps/backend/src/mail/mail.service.ts @@ -183,10 +183,7 @@ export class MailService implements OnModuleInit, OnModuleDestroy { private async getActionParam(action: number, param1: Nullable) { if ([1, 2].includes(action)) { - const cropId = (await this.databaseService.query(mailQueries.getCropName, [param1])).rows[0] - .crop_name; - - switch (cropId) { + switch (param1) { case 1: return '당근'; case 2: @@ -197,6 +194,8 @@ export class MailService implements OnModuleInit, OnModuleDestroy { return '버섯'; case 5: return '사과'; + default: + return ''; } } else if ([4, 5, 7].includes(action)) { const result = await this.databaseService.query(mailQueries.getMemberNickNameByMemberID, [