From 590cd8c101a9db6d7616d08770c8165f08f7215b Mon Sep 17 00:00:00 2001 From: yyypearl Date: Sat, 8 Jun 2024 02:56:00 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix(#126):=20=ED=86=A0=EC=9A=94=EC=9D=BC=20?= =?UTF-8?q?=EC=9B=94=EA=B0=84=20=EA=B8=89=EC=8B=9D=ED=91=9C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/MealTablePopup.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/home/MealTablePopup.tsx b/src/components/home/MealTablePopup.tsx index 5ecb1a2..3ce8303 100644 --- a/src/components/home/MealTablePopup.tsx +++ b/src/components/home/MealTablePopup.tsx @@ -47,7 +47,7 @@ const MealTablePopup = ({ onClose }: { onClose: () => void }) => { .then((response) => { const mealTableData: MealTable[] = response.data.menus; setMealTable(mealTableData); - + console.log(mealTableData); /* 월 계산 */ let month = mealTableData[0].date.slice(5, 7); if (month[0] === "0") { @@ -74,7 +74,7 @@ const MealTablePopup = ({ onClose }: { onClose: () => void }) => { if ( (currentWeekStartDay !== null && mealDay >= currentWeekStartDay && - mealDay < currentWeekStartDay + 5 && + mealDay < currentWeekStartDay + 6 && mealDayOfWeek !== 0) || // 일요일 제외 currentWeek.length === 0 ) { From c9a4e660cfb491c67241d9311a2419f200afcccf Mon Sep 17 00:00:00 2001 From: yyypearl Date: Thu, 27 Jun 2024 06:00:01 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore(#128):=20=EC=84=9C=EB=B2=84=20?= =?UTF-8?q?=EC=A3=BC=EC=86=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/auth/postKakaoToken.tsx | 2 +- src/apis/school/getShcool.tsx | 2 +- src/apis/user/postUser.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apis/auth/postKakaoToken.tsx b/src/apis/auth/postKakaoToken.tsx index bca7d40..fd7dca0 100644 --- a/src/apis/auth/postKakaoToken.tsx +++ b/src/apis/auth/postKakaoToken.tsx @@ -11,7 +11,7 @@ export async function postKakaoToken( ): Promise { try { const response = await axios.post( - "https://api.ncp.simproject.kr/api/v1/auth/login/KAKAO", + "https://api.schoolpoint.site/api/v1/auth/login/KAKAO", { accessToken: accessToken, } diff --git a/src/apis/school/getShcool.tsx b/src/apis/school/getShcool.tsx index 9f8e0a3..bd89ef5 100644 --- a/src/apis/school/getShcool.tsx +++ b/src/apis/school/getShcool.tsx @@ -7,7 +7,7 @@ interface GetSchoolResponse { export async function getSchool(keyword: string): Promise { const response = await axios.get( - `https://api.ncp.simproject.kr/api/v1/schools?keyword=${keyword}` + `https://api.schoolpoint.site/api/v1/schools?keyword=${keyword}` ); return response.data; } diff --git a/src/apis/user/postUser.tsx b/src/apis/user/postUser.tsx index db65bdf..21c26f7 100644 --- a/src/apis/user/postUser.tsx +++ b/src/apis/user/postUser.tsx @@ -4,7 +4,7 @@ import axios from "axios"; export async function postUser(user: PostUserRequest): Promise { try { const response = await axios.post( - "https://api.ncp.simproject.kr/api/v1/users", + "https://api.schoolpoint.site/api/v1/users", user ); return response.data; From 59b5d0d715564675b66af2c3f130ff0adc7eeb5e Mon Sep 17 00:00:00 2001 From: yyypearl Date: Wed, 14 Aug 2024 01:15:37 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix(#130):=20=EC=A3=BC=EC=B0=A8=EB=B3=84=20?= =?UTF-8?q?=EA=B8=89=EC=8B=9D=20=EB=82=A0=EC=A7=9C=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/MealTablePopup.tsx | 32 +++++++++++--------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/components/home/MealTablePopup.tsx b/src/components/home/MealTablePopup.tsx index 3ce8303..a064d2e 100644 --- a/src/components/home/MealTablePopup.tsx +++ b/src/components/home/MealTablePopup.tsx @@ -58,38 +58,32 @@ const MealTablePopup = ({ onClose }: { onClose: () => void }) => { const weeklyMealTable: MealTable[][] = []; let currentWeek: MealTable[] = []; /* 주차별 시작일 */ - let currentWeekStartDay: number | null = null; mealTableData.forEach((meal) => { const mealDate = new Date(meal.date); - const mealDay = mealDate.getDate(); const mealDayOfWeek = mealDate.getDay(); - /* 이번 주차 시작일 */ - if (currentWeekStartDay === null) { - currentWeekStartDay = mealDay; + /* 주차별로 월요일에 새로운 주차를 시작 */ + if (mealDayOfWeek === 1 && currentWeek.length > 0) { + weeklyMealTable.push(currentWeek); + currentWeek = []; } - /* 이번 주차에 있는 날짜인지 확인 */ + currentWeek.push(meal); + + /* 마지막 날에 현재 주차 데이터를 추가 */ + const lastMealDate = new Date( + mealTableData[mealTableData.length - 1].date + ); if ( - (currentWeekStartDay !== null && - mealDay >= currentWeekStartDay && - mealDay < currentWeekStartDay + 6 && - mealDayOfWeek !== 0) || // 일요일 제외 - currentWeek.length === 0 + mealDayOfWeek === 5 || + mealDate.getTime() === lastMealDate.getTime() ) { - currentWeek.push(meal); - } else { weeklyMealTable.push(currentWeek); - currentWeek = [meal]; - currentWeekStartDay = mealDay; + currentWeek = []; } }); - if (currentWeek.length > 0) { - weeklyMealTable.push(currentWeek); - } - setWeeklyMealTable(weeklyMealTable); }) .catch(() => { From 17b18388b49de3b392ac9d8b754ef294c62e0c33 Mon Sep 17 00:00:00 2001 From: yyypearl Date: Wed, 14 Aug 2024 01:15:58 +0900 Subject: [PATCH 4/4] =?UTF-8?q?chore(#130):=20=EB=B9=8C=EB=93=9C=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=EC=82=AC=ED=95=AD=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next.config.mjs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index b4f5ba2..e530e8f 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -30,14 +30,7 @@ export default withPlugins( }, }, ], - [ - typescript, - { - typescriptLoaderOptions: { - transpileOnly: false, - }, - }, - ], + [typescript], ], nextConfig );