-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
489 additions
and
476 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { PostAuthParamsType } from '../types/auth'; | ||
import { instance } from './instance'; | ||
|
||
export const postUserInfo = async ({ roomUUID, form }: PostAuthParamsType) => { | ||
const { data } = await instance.post( | ||
`/api/room/${roomUUID}/login`, | ||
JSON.stringify(form) | ||
); | ||
|
||
return data; | ||
}; |
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,33 @@ | ||
import { instance } from './instance'; | ||
import { PutAvailableTimesParamsType } from '../types/addTime'; | ||
|
||
export const putAvailableTimes = async ({ | ||
roomUUID, | ||
payload, | ||
}: PutAvailableTimesParamsType) => { | ||
const { data } = await instance.put( | ||
`/api/room/${roomUUID}/available-time`, | ||
JSON.stringify(payload) | ||
); | ||
|
||
return data; | ||
}; | ||
|
||
export const getAvailableTimesByOne = async ( | ||
roomUUID: string, | ||
userName: string | ||
) => { | ||
const { data } = await instance.get( | ||
`/api/room/${roomUUID}/available-time?name=${userName}` | ||
); | ||
|
||
return data; | ||
}; | ||
|
||
export const getAvailableTimesByGroup = async (roomUUID: string) => { | ||
const { data } = await instance.get( | ||
`/api/room/${roomUUID}/available-time/group` | ||
); | ||
|
||
return data; | ||
}; |
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import axios from 'axios'; | ||
|
||
export const API = axios.create({ | ||
export const instance = axios.create({ | ||
baseURL: process.env.REACT_APP_API_PATH, | ||
headers: { | ||
'Content-Type': 'application/json', | ||
withCredentials: true, | ||
}, | ||
}); |
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 { instance } from './instance'; | ||
|
||
export const getCandidateTimesInfo = async ( | ||
roomUUID: string, | ||
sort: string, | ||
name: string | ||
) => { | ||
const { data } = await instance.get( | ||
`/api/room/${roomUUID}/adjustment-result?sorted=${sort}&${name}` | ||
); | ||
|
||
return data; | ||
}; |
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,14 @@ | ||
import { instance } from './instance'; | ||
import { PostRoomTypes } from '../types/roomInfo'; | ||
|
||
export const getRoomInfo = async (roomUUID: string) => { | ||
const { data } = await instance.get(`/api/room/${roomUUID}`); | ||
|
||
return data; | ||
}; | ||
|
||
export const createRoom = async (payload: PostRoomTypes) => { | ||
const { data } = await instance.post(`/api/room`, JSON.stringify(payload)); | ||
|
||
return data; | ||
}; |
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,8 @@ | ||
export const initialCreateRoomData = { | ||
headCount: null, | ||
dates: [], | ||
startTime: null, | ||
endTime: null, | ||
timer: null, | ||
title: '', | ||
}; |
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 @@ | ||
export const initialRoomInfoData = { | ||
title: '', | ||
headCount: 0, | ||
participants: [], | ||
deadLine: null, | ||
dates: [], | ||
startTime: null, | ||
endTime: null, | ||
}; |
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
import { atom, selector } from 'recoil'; | ||
import { PostRoomTypes } from '../types/roomInfo'; | ||
import { initialCreateRoomData } from '../assets/data/initialCreateRoomData'; | ||
|
||
export const createRoomAtoms = atom<PostRoomTypes>({ | ||
key: 'recoilRoomAtoms', | ||
default: initialCreateRoomData, | ||
}); | ||
|
||
export const createRoomInfoState = selector({ | ||
key: 'recoilRoomInfoState', // ๊ณ ์ ํ ํค ๊ฐ | ||
get: ({ get }) => { | ||
const roomInfo = get(createRoomAtoms); | ||
return roomInfo; | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.