From 6aa4b4f45ff681aab97ea163189cebf5ecf0f552 Mon Sep 17 00:00:00 2001 From: Lee sang Yeop Date: Sun, 4 Feb 2024 19:00:32 +0900 Subject: [PATCH] =?UTF-8?q?fix(majorUtils=20getDepartmentIdByMajor):=20?= =?UTF-8?q?=EB=8D=94=20=EC=9C=A0=EC=97=B0=ED=95=98=EA=B2=8C=20=ED=95=99?= =?UTF-8?q?=EA=B3=BC=20ID=20=EA=B0=92=EC=9D=84=20=EA=B5=AC=ED=95=A0=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/majorUtils.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/utils/majorUtils.ts b/src/utils/majorUtils.ts index 70cfbcd..5f8eb4e 100644 --- a/src/utils/majorUtils.ts +++ b/src/utils/majorUtils.ts @@ -2,10 +2,7 @@ import { selectQuery } from '@db/query/dbQueryHandler'; import notificationToSlack from 'src/hooks/notificateToSlack'; export const getDepartmentIdByMajor = async (major: string) => { - const [departmentName, departmentSubName] = major.split(' '); - const getDepartmentQuery = `SELECT id FROM departments WHERE department_name = '${departmentName}' ${ - departmentSubName ? `AND department_subname = '${departmentSubName}'` : '' - };`; + const getDepartmentQuery = `SELECT id FROM departments WHERE department_name = '${major}' OR department_subname = '${major}'`; try { const departmentId = await selectQuery<{ id: number }[]>(