Skip to content

Commit

Permalink
Merge pull request #183 from GDSC-PKNU-Official/fix/#181
Browse files Browse the repository at this point in the history
fix(majorUtils getDepartmentIdByMajor): 특정 학과의 경우 공지사항 조회 및 알림설정이 불가했던 문제 해결
  • Loading branch information
pp449 authored Feb 6, 2024
2 parents 264039f + 6aa4b4f commit 9396fbe
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/utils/majorUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }[]>(
Expand Down

0 comments on commit 9396fbe

Please sign in to comment.