Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
PineND committed Dec 5, 2024
1 parent 27a908a commit d116b59
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions apps/frontend/src/components/Detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,18 @@ export default function AttendanceRequirements({
if (!courseData?.course?.classes) return [] as TermInfo[];

return _.chain(courseData.course.classes as ClassInfo[])
.map((classInfo: ClassInfo): TermInfo => ({
value: `${classInfo.semester} ${classInfo.year}`,
label: `${classInfo.semester} ${classInfo.year}`,
semester: classInfo.semester as Semester,
year: classInfo.year,
}))
.map(
(classInfo: ClassInfo): TermInfo => ({
value: `${classInfo.semester} ${classInfo.year}`,
label: `${classInfo.semester} ${classInfo.year}`,
semester: classInfo.semester as Semester,
year: classInfo.year,
})
)
.uniqBy((term: TermInfo) => `${term.semester}-${term.year}`)
.orderBy(
[
'year',
"year",
(term: TermInfo) => {
const semesterOrder = {
[Semester.Spring]: 0,
Expand All @@ -123,7 +125,7 @@ export default function AttendanceRequirements({
return semesterOrder[term.semester];
},
] as const,
['desc', 'asc']
["desc", "asc"]
)
.value() as TermInfo[];
}, [courseData]);
Expand Down

0 comments on commit d116b59

Please sign in to comment.