Skip to content

Commit

Permalink
Merge pull request #152 from boostcampwm-2024/fix/be/cropname
Browse files Browse the repository at this point in the history
[BE/fix] 알림 작성 시 작물명 한글로 보내도록 수정
  • Loading branch information
edder773 authored Dec 2, 2024
2 parents 589a3c7 + 269920b commit 1e4127c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions apps/backend/src/mail/mail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,20 @@ export class MailService implements OnModuleInit, OnModuleDestroy {

private async getActionParam(action: number, param1: Nullable<number>) {
if ([1, 2].includes(action)) {
const result = await this.databaseService.query(mailQueries.getCropName, [param1]);
return result.rows[0]?.crop_name || '';
switch (param1) {
case 1:
return '당근';
case 2:
return '수박';
case 3:
return '포도';
case 4:
return '버섯';
case 5:
return '사과';
default:
return '';
}
} else if ([4, 5, 7].includes(action)) {
const result = await this.databaseService.query(mailQueries.getMemberNickNameByMemberID, [
param1
Expand Down

0 comments on commit 1e4127c

Please sign in to comment.