-
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.
Merge pull request #34 from YAPP-Github/refactor/YS-224
[REFACTOR] zod 활용하여 회원가입 validation 적용
- Loading branch information
Showing
51 changed files
with
969 additions
and
625 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,18 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
import { getParticipantInfo } from '@/apis/login'; | ||
|
||
interface useParticipantInfoQueryProps { | ||
enabled: boolean; | ||
} | ||
|
||
const useParticipantInfoQuery = ({ enabled }: useParticipantInfoQueryProps) => { | ||
return useQuery({ | ||
queryKey: ['participantInfo'], | ||
queryFn: getParticipantInfo, | ||
enabled, | ||
retry: 1, | ||
}); | ||
}; | ||
|
||
export default useParticipantInfoQuery; |
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 { useQuery } from '@tanstack/react-query'; | ||
|
||
import { getResearcherInfo } from '@/apis/login'; | ||
|
||
interface useResearcherInfoQueryProps { | ||
enabled: boolean; | ||
} | ||
|
||
const useResearcherInfoQuery = ({ enabled }: useResearcherInfoQueryProps) => { | ||
return useQuery({ | ||
queryKey: ['researcherInfo'], | ||
queryFn: getResearcherInfo, | ||
enabled, | ||
retry: 1, | ||
}); | ||
}; | ||
|
||
export default useResearcherInfoQuery; |
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,22 @@ | ||
import useParticipantInfoQuery from './useParticipantInfoQuery'; | ||
import useResearcherInfoQuery from './useResearcherInfoQuery'; | ||
|
||
import { ROLE } from '@/constants/config'; | ||
import useSessionStorage from '@/hooks/useSessionStorage'; | ||
|
||
const useUserInfo = () => { | ||
const role = useSessionStorage('role'); | ||
const isParticipant = role === ROLE.participant; | ||
const isResearcher = role === ROLE.researcher; | ||
|
||
const participantQuery = useParticipantInfoQuery({ enabled: isParticipant }); | ||
const researcherQuery = useResearcherInfoQuery({ enabled: isResearcher }); | ||
|
||
return { | ||
userInfo: isParticipant ? participantQuery.data : researcherQuery.data, | ||
isLoading: participantQuery.isLoading || researcherQuery.isLoading, | ||
isError: participantQuery.isError || researcherQuery.isError, | ||
}; | ||
}; | ||
|
||
export default useUserInfo; |
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
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
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...eckboxContainer/JoinCheckboxContainer.tsx → ...eckboxContainer/JoinCheckboxContainer.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 was deleted.
Oops, something went wrong.
Oops, something went wrong.