Skip to content

Commit

Permalink
chore: 3 days for OT
Browse files Browse the repository at this point in the history
  • Loading branch information
k1g99 committed Feb 11, 2024
1 parent baf7ad5 commit 1067c24
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/init_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/screen/setting/scheduleSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ export default function ScheduleSettingScreen() {
const token = useRecoilValue(accesstoken)
const [firstDate, setFirstDate] = useState<Date>(new Date())
const [secondDate, setSecondDate] = useState<Date>(new Date())
const [thirdDate, setThirdDate] = useState<Date>(new Date())


const schedule = useQuery('getSchedule', async () => await ScheduleService.get(token), {
onSuccess: (data) => {
// console.log(data)
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
Expand Down Expand Up @@ -92,7 +95,7 @@ export default function ScheduleSettingScreen() {
</>
)}

{/* <Grid item>
<Grid item>
<Card>
<CardContent>
<Typography>DAY 3</Typography>
Expand All @@ -107,14 +110,15 @@ export default function ScheduleSettingScreen() {
/>
</CardContent>
</Card>
</Grid> */}
</Grid>
</React.Fragment>
)
}

const saveDate = (event: React.MouseEvent<HTMLElement>) => {
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 = () => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/service/base.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/service/notice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/service/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1067c24

Please sign in to comment.