Skip to content

Commit

Permalink
๐Ÿฉน ๊ต๊ณผ๋ชฉ ๋ณ€๊ฒฝ๋‚ด์—ญ ์ธ์ž ์ „๋‹ฌ ์˜ค๋ฅ˜ ์ˆ˜์ • (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
Limchansol authored Nov 7, 2023
1 parent 344b14f commit a74c3e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/[locale]/academics/graduate/course-changes/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const getSelectedChanges = (selectedYear: number, data: CourseChange[]) => {

// TODO: ์—ฐ๋„ ์ถ”๊ฐ€๋˜์–ด๋„ ํƒ€์ž„๋ผ์ธ ์ž˜ ์„ค์ •๋˜๋„๋ก ๋ฆฌํŒฉํ† ๋ง
export default function GraduateCourseChangesPage() {
const { data } = useSWR('/academics/graduate/course-changes', getCourseChanges);
const { data } = useSWR('graduate', getCourseChanges);
const [selectedYear, setSelectedYear] = useState<number>(2020);
const selectedChanges = getSelectedChanges(selectedYear, data ?? []);

Expand Down
4 changes: 3 additions & 1 deletion app/[locale]/academics/undergraduate/course-changes/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const TIME_SPOTS: { year: number; margin?: string; isLast?: boolean }[] = [
];

const getSelectedChanges = (selectedYear: number, data: CourseChange[]) => {
console.log('์„ ํƒ ์—ฐ๋„', selectedYear);
console.log(data);
if (selectedYear <= YEAR_LIMIT) return data.filter((d) => d.year <= YEAR_LIMIT);

const change = data.find((d) => d.year === selectedYear);
Expand All @@ -39,7 +41,7 @@ const getSelectedChanges = (selectedYear: number, data: CourseChange[]) => {

// TODO: ์—ฐ๋„ ์ถ”๊ฐ€๋˜์–ด๋„ ํƒ€์ž„๋ผ์ธ ์ž˜ ์„ค์ •๋˜๋„๋ก ๋ฆฌํŒฉํ† ๋ง
export default function UndergraduateCourseChangesPage() {
const { data } = useSWR('/academics/undergraduate/course-changes', getCourseChanges);
const { data } = useSWR('undergraduate', getCourseChanges);
const [selectedYear, setSelectedYear] = useState<number>(2020);
const selectedChanges = getSelectedChanges(selectedYear, data ?? []);

Expand Down

0 comments on commit a74c3e3

Please sign in to comment.