-
Notifications
You must be signed in to change notification settings - Fork 0
온보딩 step-4 complete API 연동 및 에러 처리 통일 #712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HA-SEUNG-JEONG
wants to merge
6
commits into
develop
Choose a base branch
from
fix/alpha-test
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a02aba0
[alpha-test] fix : 기타+ 버튼 입력 UI Figma 정렬
HA-SEUNG-JEONG b4ab8dd
[alpha-test] fix : chore(onboarding): complete 엔드포인트 타입·API함수·뮤테이션 훅 추가
HA-SEUNG-JEONG bbc052b
[alpha-test] fix : feat(onboarding): step-4 complete API 연동
HA-SEUNG-JEONG d5b2220
[alpha-test] fix : refactor(onboarding): class-onboarding 엔드포인트 에러 처리…
HA-SEUNG-JEONG 992ee0f
[alpha-test] fix : [alpha-test] refactor(onboarding): 온보딩 뮤테이션 훅 래퍼 파…
HA-SEUNG-JEONG 2442ebb
[alpha-test] fix : [alpha-test] refactor(onboarding): 온보딩 스텝 컴포넌트에 us…
HA-SEUNG-JEONG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,88 @@ | ||
| import { axiosInstance } from '@/api/client/axios'; | ||
| import type { | ||
| ClassOnboardingCompleteRequest, | ||
| ClassOnboardingStep1Request, | ||
| ClassOnboardingStep2Request, | ||
| ClassOnboardingStep3Request, | ||
| ClassOnboardingStepResponse, | ||
| } from '@/types/api/class-onboarding.types'; | ||
|
|
||
| export const saveClassOnboardingStep1 = async ( | ||
| data: ClassOnboardingStep1Request, | ||
| ): Promise<ClassOnboardingStepResponse> => { | ||
| try { | ||
| const { data: resData } = await axiosInstance.post( | ||
| '/v6/class-onboarding/me/step-1', | ||
| data, | ||
| ); | ||
|
|
||
| if (resData.statusCode !== 200) { | ||
| throw new Error('Failed to save class onboarding step 1'); | ||
| } | ||
|
|
||
| return resData.content; | ||
| } catch (err) { | ||
| console.error('Error saving class onboarding step 1:', err); | ||
| throw err; | ||
| } | ||
| }; | ||
|
|
||
| export const saveClassOnboardingStep2 = async ( | ||
| data: ClassOnboardingStep2Request, | ||
| ): Promise<ClassOnboardingStepResponse> => { | ||
| try { | ||
| const { data: resData } = await axiosInstance.post( | ||
| '/v6/class-onboarding/me/step-2', | ||
| data, | ||
| ); | ||
|
|
||
| if (resData.statusCode !== 200) { | ||
| throw new Error('Failed to save class onboarding step 2'); | ||
| } | ||
|
|
||
| return resData.content; | ||
| } catch (err) { | ||
| console.error('Error saving class onboarding step 2:', err); | ||
| throw err; | ||
| } | ||
| }; | ||
|
|
||
| export const saveClassOnboardingStep3 = async ( | ||
| data: ClassOnboardingStep3Request, | ||
| ): Promise<ClassOnboardingStepResponse> => { | ||
| try { | ||
| const { data: resData } = await axiosInstance.post( | ||
| '/v6/class-onboarding/me/step-3', | ||
| data, | ||
| ); | ||
|
|
||
| if (resData.statusCode !== 200) { | ||
| throw new Error('Failed to save class onboarding step 3'); | ||
| } | ||
|
|
||
| return resData.content; | ||
| } catch (err) { | ||
| console.error('Error saving class onboarding step 3:', err); | ||
| throw err; | ||
| } | ||
| }; | ||
|
|
||
| export const saveClassOnboardingComplete = async ( | ||
| data: ClassOnboardingCompleteRequest, | ||
| ): Promise<ClassOnboardingStepResponse> => { | ||
| try { | ||
| const { data: resData } = await axiosInstance.post( | ||
| '/v6/class-onboarding/me/complete', | ||
| data, | ||
| ); | ||
|
|
||
| if (resData.statusCode !== 200) { | ||
| throw new Error('Failed to save class onboarding complete'); | ||
| } | ||
|
|
||
| return resData.content; | ||
| } catch (err) { | ||
| console.error('Error saving class onboarding complete:', err); | ||
| throw err; | ||
| } | ||
| }; | ||
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 17920
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 965
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 187
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 12692
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 9847
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 25555
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 1850
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 22113
🏁 Script executed:
Repository: code-zero-to-one/study-platform-client
Length of output: 3082
class-onboarding 엔드포인트 에러 처리가 utils/error-handler 기준에 맞지 않습니다.
src/api/endpoints/class-onboarding/class-onboarding.ts(10-88)의saveClassOnboardingStep1~saveClassOnboardingComplete는catch에서console.error후throw만 하고,utils/error-handler.ts의analyzeError/sendErrorToSentry및useToastStore기반 사용자 토스트 처리가 없습니다.useMutation에onError를 제공하며(예:step-1-nickname.tsx등), 그 경우 전역src/config/query-client.ts의MutationCache.onError(=useToastStore.getState().showToast+sendErrorToSentry)가 스킵됩니다. 즉, 현재 구현에서는 사용자 토스트/센트리 전송이 누락될 수 있습니다.resData.statusCode !== 200일 때도 백엔드의 에러 코드/메시지를 담지 못한 일반Error('Failed to ...')를 던져analyzeError가 의미 있는 userMessage를 만들기 어렵습니다.🤖 Prompt for AI Agents