-
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.
* feat: axios instance 재설정 * feat: 방 정보 불러오기 api 분리 * chore: tanstack-query 초기 세팅 - 쿼리 키 생성 * feat: tanstack-query 도입 * feat: 방 생성 쿼리 작성 * feat: 참여자가 등록한 시간 불러오기 api 쿼리 작성 * feat: 일정 등록/수정 api 쿼리 작성 * feat: 후보 시간 조회 api tanstack-query 도입 * feat: 로그인 api tanstack-query 도입 * feat: 날짜 없는 방에도 tanstack-query 적용 * chore: 기존의 axios instance 제거 * fix: 후보 시간 불러오기 에러 해결 * chore: 폴더 구조 변경
- Loading branch information
1 parent
173bec7
commit 73881b6
Showing
43 changed files
with
508 additions
and
494 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.