forked from YJU-OKURA/project_minori-next-deployment-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat : Add Schedule component APIs & layout
- Create Class Schedule API - Delete Class Schedule API - Get Class Schedule API - Adding layout and the react-calendar library Related Issue : YJU-OKURA#101 YJU-OKURA#99
- Loading branch information
Showing
28 changed files
with
1,070 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import req from '../apiUtils'; | ||
|
||
const deleteClassSchedule = async (sid: number, cid: number, uid: number) => { | ||
const response = await req( | ||
`/cs/${sid}?cid=${cid}&uid=${uid}`, | ||
'delete', | ||
'gin' | ||
); | ||
|
||
return response.data; | ||
}; | ||
|
||
export default deleteClassSchedule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import req from '../apiUtils'; | ||
|
||
const getClassSchedule = async (scheduleCode: number) => { | ||
const response = await req(`/cs/${scheduleCode}`, 'get', 'gin'); | ||
|
||
return response.data; | ||
}; | ||
|
||
export default getClassSchedule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import req from '../apiUtils'; | ||
|
||
const getClassScheduleList = async (classCode: number) => { | ||
const response = await req(`/cs?cid=${classCode}`, 'get', 'gin'); | ||
|
||
return response; | ||
}; | ||
|
||
export default getClassScheduleList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import getClassSchedule from './getClassSchedule'; | ||
import getClassScheduleList from './getClassScheduleList'; | ||
import postCreateClassSchedule from './postCreateClassSchedule'; | ||
import deleteClassSchedule from './deleteClassSchedule'; | ||
import putClassSchedule from './putClassSchedule'; | ||
|
||
const classScheduleAPI = { | ||
getClassSchedule, | ||
getClassScheduleList, | ||
postCreateClassSchedule, | ||
deleteClassSchedule, | ||
putClassSchedule, | ||
}; | ||
|
||
export default classScheduleAPI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import req from '../apiUtils'; | ||
import {PostCreateScheduleData} from '@/src/interfaces/api/_class'; | ||
|
||
const postCreateClassSchedule = async (postData: PostCreateScheduleData) => { | ||
const data = { | ||
cid: postData.cid, | ||
ended_at: postData.ended_at, | ||
is_live: postData.is_live, | ||
started_at: postData.started_at, | ||
title: postData.title, | ||
}; | ||
|
||
const response = await req(`/cs?uid=${postData.uid}`, 'post', 'gin', data); | ||
|
||
return response; | ||
}; | ||
|
||
export default postCreateClassSchedule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import req from '../apiUtils'; | ||
import {PutClassScheduleData} from '@/src/interfaces/api/_class'; | ||
|
||
const putClassSchedule = async (requestData: PutClassScheduleData) => { | ||
const requestForm = { | ||
ended_at: requestData.ended_at, | ||
is_live: requestData.is_live, | ||
started_at: requestData.started_at, | ||
title: requestData.title, | ||
}; | ||
const response = await req( | ||
`/cs/${requestData.sid}?cid=${requestData.cid}&uid=${requestData.uid}`, | ||
'put', | ||
'gin', | ||
requestForm | ||
); | ||
|
||
return response; | ||
}; | ||
|
||
export default putClassSchedule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.