Skip to content

Commit

Permalink
Merge pull request #124 from Kusitms-29th-ASAP/fix/#123
Browse files Browse the repository at this point in the history
[Fix] 알러지 조개류 반환 오류
  • Loading branch information
yyypearl authored Jun 7, 2024
2 parents dc58205 + da740f4 commit 727b7ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/components/mypage/AllergyPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ const AllergyPopup = (props: AllergyProps) => {
const sortedAllergy = selectedAllergy.sort((a, b) => {
const aIndex = allergiesData.findIndex((data) => data.Allergy === a);
const bIndex = allergiesData.findIndex((data) => data.Allergy === b);

// 숫자 형식으로 변환
const aNumber = parseInt(a, 10);
const bNumber = parseInt(b, 10);

// 숫자를 기준으로 비교
if (!isNaN(aNumber) && !isNaN(bNumber)) {
return aNumber - bNumber;
}

return aIndex - bIndex;
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/school/notification/TodayNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const TodayNotification = () => {
<TodayTitle>오늘의 알림장</TodayTitle>
{notiData[0] !== null ? (
<Notification
day={"2024-05-25"}
day={notiData[0]?.writeDate}
teacher={teacher}
notifications={notiData[0]}
isToday={true}
Expand Down
2 changes: 1 addition & 1 deletion src/data/allergyData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ export const allergiesData = [
{ Number: 15, Allergy: 'CHICKEN', Description: '닭고기' },
{ Number: 16, Allergy: 'BEEF', Description: '쇠고기' },
{ Number: 17, Allergy: 'SQUID', Description: '오징어' },
{ Number: 18, Allergy: 'SHELLFISH', Description: '조개류(굴, 전복, 홍합 포함)' },
{ Number: 18, Allergy: 'SHELLFISH', Description: '조개류' },
{ Number: 19, Allergy: 'PINE_NUT', Description: '잣' }
];

0 comments on commit 727b7ce

Please sign in to comment.