-
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.
cowork/room: 룸 구현 밑 프론트 서버 연동 완료 (#148)
* refactor(Message): Message color가 client의 npm run build를 방해함 * socket cors * winston 남은 것들 제거 * room, user many to many로 시험적 변경 * feat(room): room 생성 성공. user id가 존재할 경우 방을 만들어줌 * with credential always * mock user 로그인으로 방 만들기 성공 * user room join 로직 협업 중 * room join Co-authored-by: Kiwon Kim <[email protected]> Co-authored-by: Daehyun Kim <[email protected]> * refactor: axios 부분 수정 axios 요청 하는 부분을 파일로 빼고 try catch를 다 적용 시켰습니다. * feat(exceptions): 모든 server exception 로깅 for debugging * 프리티어 성능 향상 Co-authored-by: Kiwon Kim <[email protected]> Co-authored-by: Seongwoo_Lukaid <[email protected]> * feat(Room): Room exit 로직 작성 중 * feat: room exit api 컨트롤러 * feat: 모든 익셉션 서버에 로깅하기 * OAuth로 로그인한 유저를 createOrUpdateUser를 통해 1. 디비에 넣거나 2. 이미 존재하면 불러온다. * feat(tsconfig): 🚑 STRICT typescript tsconfig strictNullChecks = true * refactor: chat에서 socket연결 로직 분리 (#142) * feat: 프론트 룸 exit 로직 * feat(room): exit room + api * fix(joinRoom): joinroom api 수정 * fix(ts): server - strict nullcheck 이전에 작성된 성주님의 problem api 수정 * 성주님 피드백대로 findUserByProviderWithRooms 만들기 * soft-remove cascade로 성공 * 이걸 안 해주면 infinite recursion으로 jsonify * bugfix: 다대다 관계 오류로 안 만들어지는 버그 수정 --------- Co-authored-by: Seongwoo_Lukaid <[email protected]> Co-authored-by: Kiwon Kim <[email protected]> Co-authored-by: kiuuon <[email protected]> Co-authored-by: Seongwoo_Lukaid <[email protected]> Co-authored-by: Kiwon Kim <[email protected]>
- Loading branch information
1 parent
efc0d1f
commit 1e2a6b3
Showing
35 changed files
with
549 additions
and
274 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import axios from 'axios'; | ||
import { CreateUser } from '../types/CreateUserType'; | ||
|
||
// const config = { | ||
// baseUrl: import.meta.env.VITE_API_BASE_URL as string, | ||
// }; | ||
|
||
export async function login(): Promise<CreateUser> { | ||
// const response = await axios.post(`${config.baseUrl}/auth/login`, {}); | ||
// mock data from /mocks/User.json | ||
const response = await axios.get('/mocks/User.json'); | ||
const VITE_BASE_URL = import.meta.env.VITE_BASE_URL as string; | ||
|
||
export async function getSession(): Promise<CreateUser> { | ||
const response = await axios.get(`${VITE_BASE_URL}/session`, { | ||
withCredentials: true, | ||
}); | ||
|
||
return response.data; | ||
} | ||
|
||
export async function logout() { | ||
axios.get(`${VITE_BASE_URL}/auth/logout`, { 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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import axios from 'axios'; | ||
import { RoomCreateType } from '../types/RoomCreateType'; | ||
|
||
const VITE_BASE_URL = import.meta.env.VITE_BASE_URL as string; | ||
|
||
export async function createRoom(): Promise<RoomCreateType | undefined> { | ||
const VITE_BASE_URL = import.meta.env.VITE_BASE_URL as string; | ||
const response = await axios.post( | ||
`${VITE_BASE_URL}/room`, | ||
{}, | ||
{ withCredentials: true }, | ||
); | ||
|
||
return await axios | ||
.post(`${VITE_BASE_URL}/room`, { | ||
userId: 1, | ||
}) | ||
.then((response) => { | ||
return response.data; | ||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
return response.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,7 @@ | ||
import axios from 'axios'; | ||
|
||
const VITE_BASE_URL = import.meta.env.VITE_BASE_URL as string; | ||
|
||
export async function exitRoom() { | ||
await axios.post(`${VITE_BASE_URL}/room/exit`, {}, { 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 axios from 'axios'; | ||
|
||
const VITE_BASE_URL = import.meta.env.VITE_BASE_URL as string; | ||
|
||
export async function joinRoom(roomCode: string) { | ||
await axios.post( | ||
`${VITE_BASE_URL}/room/join`, | ||
{ code: roomCode }, | ||
{ | ||
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
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
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.