From 1067c247a10941e90ddffec321f9ef2763fc2ce7 Mon Sep 17 00:00:00 2001 From: k1g99 Date: Sun, 11 Feb 2024 15:25:04 +0900 Subject: [PATCH] chore: 3 days for OT --- backend/init_db.sh | 2 +- frontend/src/screen/setting/scheduleSetting.tsx | 8 ++++++-- frontend/src/service/base.service.ts | 3 ++- frontend/src/service/notice.service.ts | 2 +- frontend/src/service/user.service.ts | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/backend/init_db.sh b/backend/init_db.sh index 20fc586..115031a 100755 --- a/backend/init_db.sh +++ b/backend/init_db.sh @@ -8,7 +8,7 @@ fi sleep 2 docker rm -f fnet-mysql-dev -docker run -it -d -e MYSQL_DATABASE=fnet -e MYSQL_USER=fnet -e MYSQL_PASSWORD=fnet -e MYSQL_ROOT_PASSWORD=root -p 127.0.0.1:1398:3306 --name fnet-mysql-dev mysql:8.0.27 +docker run -it -d -e MYSQL_DATABASE=fnet -e MYSQL_USER=fnet -e MYSQL_PASSWORD=fnet -e MYSQL_ROOT_PASSWORD=root -p 127.0.0.1:1398:3306 --name fnet-mysql-dev mysql if [ "$1" = "--migrate" ]; then sleep 3 diff --git a/frontend/src/screen/setting/scheduleSetting.tsx b/frontend/src/screen/setting/scheduleSetting.tsx index 5d8709f..983b3a6 100644 --- a/frontend/src/screen/setting/scheduleSetting.tsx +++ b/frontend/src/screen/setting/scheduleSetting.tsx @@ -19,6 +19,8 @@ export default function ScheduleSettingScreen() { const token = useRecoilValue(accesstoken) const [firstDate, setFirstDate] = useState(new Date()) const [secondDate, setSecondDate] = useState(new Date()) + const [thirdDate, setThirdDate] = useState(new Date()) + const schedule = useQuery('getSchedule', async () => await ScheduleService.get(token), { onSuccess: (data) => { @@ -26,6 +28,7 @@ export default function ScheduleSettingScreen() { if (data.data.length >= 2) { setFirstDate(new Date(data.data[0].date)) setSecondDate(new Date(data.data[1].date)) + setThirdDate(new Date(data.data[2].date)) } }, refetchOnWindowFocus: false @@ -92,7 +95,7 @@ export default function ScheduleSettingScreen() { )} - {/* + DAY 3 @@ -107,7 +110,7 @@ export default function ScheduleSettingScreen() { /> - */} + ) } @@ -115,6 +118,7 @@ export default function ScheduleSettingScreen() { const saveDate = (event: React.MouseEvent) => { setSchedule.mutate({date: new Date(firstDate), day: 1 }) setSchedule.mutate({date: new Date(secondDate), day: 2 }) + setSchedule.mutate({date: new Date(thirdDate), day: 3 }) } const SaveButton = () => { diff --git a/frontend/src/service/base.service.ts b/frontend/src/service/base.service.ts index c7c9f00..8010486 100644 --- a/frontend/src/service/base.service.ts +++ b/frontend/src/service/base.service.ts @@ -64,7 +64,8 @@ class RequestConfig { class BaseService { private getConfig(token?: string): RequestConfig { - const requestConfig = new RequestConfig('http://fgnet.click/api/') + const requestConfig = new RequestConfig('https://fgnet.click/api/') + // const requestConfig = new RequestConfig('http://127.0.0.1:8000/api/') if (token) { requestConfig.setToken(token) diff --git a/frontend/src/service/notice.service.ts b/frontend/src/service/notice.service.ts index 7b06e35..13da0fe 100644 --- a/frontend/src/service/notice.service.ts +++ b/frontend/src/service/notice.service.ts @@ -6,7 +6,7 @@ class NoticeServiceClass { return await api.post('admin/notice/', input, token); } async get(id?:number, token?: string) { - const data = id ? await api.get(`notice?id=${id}`, token) : await api.get('notice', token) + const data = id ? await api.get(`notice?id=${id}`, token) : await api.get('notice/', token) return data.data } } diff --git a/frontend/src/service/user.service.ts b/frontend/src/service/user.service.ts index 67f9ac1..ce91220 100644 --- a/frontend/src/service/user.service.ts +++ b/frontend/src/service/user.service.ts @@ -17,7 +17,7 @@ class UserService { return data.data } async getAll(token: string) { - return await api.get('admin/fg', token) + return await api.get('admin/fg/', token) } async post(file: any, token: string) { return await api.post('admin/fg/upload/', file, token)