Skip to content
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

[GGFE-83] 메인 403에러 alert 추가 #861

Merged
merged 2 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion hooks/modal/match/useMatchEnrollModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ const useMatchEnrollModal = ({ startTime, mode }: EnrollProps) => {
await instance.post(`/pingpong/match?type=${mode}`, body);
alert(enrollResponse.SUCCESS);
} catch (e: any) {
console.log(e);
if (e.response.data.code in enrollResponse)
alert(enrollResponse[e.response.data.code]);
else {
setModal({ modalName: null });
if (e.response.status === 403) {
alert('카카오 유저는 경기에 등록할 수 없습니다.');
return;
}
setError('JH05');
return;
}
Expand Down
15 changes: 8 additions & 7 deletions hooks/modal/useEditProfileModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ const useEditProfileModal = ({
editedProfile.snsNotiOpt = 'NONE';
}

setProfile((prev) => ({
...prev,
...editedProfile,
}));

try {
await instance.put(`/pingpong/users/${intraId}`, editedProfile);
setProfile((prev) => ({
...prev,
...editedProfile,
}));
alert('프로필이 성공적으로 등록되었습니다.');
} catch (e) {
setError('JH02');
} catch (e: any) {
if (e.response.status === 403) {
alert('카카오 유저는 프로필을 수정할 수 없습니다.');
} else setError('JH02');
}
setModal({ modalName: null });
};
Expand Down