Skip to content

Commit

Permalink
fix(notice/service): 학과 공지사항을 DB에서 꺼낼 때 날짜 순서대로 정렬해서 꺼내도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
pp449 committed Jan 11, 2024
1 parent 740bdb2 commit 07997f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/apis/notice/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const updateNotice = (notices: Notices[]) => {

export const getNotices = async (department: string): Promise<SeparateNoti> => {
const majorId = await getDepartmentIdByMajor(department);
const query = `SELECT * FROM major_notices WHERE department_id = ${majorId};`;
const query = `SELECT * FROM major_notices WHERE department_id = ${majorId} ORDER BY STR_TO_DATE(upload_date, '%Y-%m-%d') DESC;`;
const major_notices = await selectQuery<Notices[]>(query);

const notices: SeparateNoti = {
Expand Down

0 comments on commit 07997f8

Please sign in to comment.