-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
로그인 시 회원 Id를 이용하여 회원정보를 hook에 저장 회원정보 조회 시 hook에 저장된 회원 정보를 불러옴 회원정보 페이지 구현 Issues #70
- Loading branch information
김병현
authored and
김병현
committed
Sep 10, 2023
1 parent
2af19ec
commit 770d5be
Showing
9 changed files
with
121 additions
and
61 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
49 changes: 36 additions & 13 deletions
49
client/src/components/Logins/LoginConfirmatationModal.tsx
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,16 @@ | ||
import { useQuery } from 'react-query'; | ||
import axios from 'axios'; | ||
|
||
function useGetMemberInfo(memberId: number | null) { | ||
return useQuery(['member', memberId], async () => { | ||
const response = await axios.get(`http://ec2-13-125-246-160.ap-northeast-2.compute.amazonaws.com:8080/members/${memberId}`); | ||
|
||
if (response.status === 200) { | ||
return response.data; | ||
} else { | ||
throw new Error('Failed to fetch member data'); | ||
} | ||
}); | ||
} | ||
|
||
export default useGetMemberInfo; |
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,11 @@ | ||
import { combineReducers } from '@reduxjs/toolkit'; | ||
import loginReducer from './loginSlice'; | ||
import memberInfoReducer from './memberInfoSlice'; | ||
|
||
const rootReducer = combineReducers({ | ||
login: loginReducer, | ||
memberInfo: memberInfoReducer, | ||
|
||
}); | ||
|
||
export type RootState = ReturnType<typeof rootReducer>; |
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