-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feat] 초대페이지 기능및디자인 QA #473
Conversation
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.
고생하셨습니다 !! ㅎㅎ
질문 몇 개만 확인해주세융
navigate(PATH.ONBOARDING); | ||
}, | ||
} | ||
); | ||
deleteLocalStorageInviteInfo(); |
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.
clearInvitation
은 어떵가요 ??
localStorage.setItem(STORAGE_KEY.TEAM_NAME, firstTeam.name); | ||
navigate(PATH.DASHBOARD); | ||
} | ||
}, [firstTeam, navigate]); |
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.
navigate도 의존성 배열에 필요한가유 ??
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.
navigate를 빼면 의존성으로 eslint가 잡더라구요 !
@@ -48,14 +49,14 @@ const WorkspaceDelete = ({ position }: WorkspaceDeleteProps) => { | |||
|
|||
closeModal(); | |||
|
|||
localStorage.removeItem('teamId'); | |||
localStorage.removeItem(STORAGE_KEY.TEAM_ID); | |||
localStorage.removeItem(STORAGE_KEY.TEAM_NAME); | |||
|
|||
navigate(PATH.DASHBOARD); | |||
window.location.reload(); |
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.
요거 reload 없이는 이상하게 동작할까요 ?
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.
그러게요 대쉬보드로만 돌아가면 되지 않나용?
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.
없어도 정상동작해서 삭제했숩니다!!
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.
고생하셨습니다~~!! 코멘트 몇개 남겼으니 확인해주세요!
@@ -54,17 +54,18 @@ const InvitedPage = () => { | |||
}, | |||
{ | |||
onSuccess: () => { | |||
deleteLocalStorageInviteInfo(); | |||
createToast('초대 승인에 성공하셨습니다.', 'success'); |
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.
상수화 하면 좋을거같아요!
navigate(PATH.DASHBOARD); | ||
}, | ||
onError: (error: components['schemas']['ErrorResponse']) => { | ||
deleteLocalStorageInviteInfo(); | ||
createToast(error.message, 'error'); | ||
createToast(`초대 승인에 실패하셨습니다: ${error.message}`, 'error'); |
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.
여기도~
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.
요거 error
타입 뮤에이트 함수에서 axios
사용하고 있다면 axiosError
타입일 것 같은데 ?? 아닌가유
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.
맞네요!
서버에서 에러 분기처리가 되지 않아서 error를 받을 필요없이 상수화된 에러메시지 띄워줬습니다~!
localStorage.setItem(STORAGE_KEY.TEAM_NAME, firstTeam.name); | ||
navigate(PATH.DASHBOARD); | ||
} | ||
}, [firstTeam, navigate]); |
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.
이미 비동기 로직을 처리하는 리액트 쿼리를 사용하여 데이터를 받아왔고, 데이터 값에 따라서 navigate를 해주는 것이니 굳이 useEffect를 안쓰고 아래와 같이 if문으로만 처리해도 동작할것 같은데 어떻게 생각하시나요!
const { data, isSuccess } = $api.useQuery('get', '/api/v1/members/teams');
const firstTeam = data?.data?.belongTeamGetResponses[0];
if (isSuccess && firstTeam) {
localStorage.setItem(STORAGE_KEY.TEAM_ID, String(firstTeam.id));
localStorage.setItem(STORAGE_KEY.TEAM_NAME, firstTeam.name);
navigate(PATH.DASHBOARD);
}
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.
오 ! 될거같다 !
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.
오! 됩니다!!!!! 좋은의견 감사합니다 👍
@@ -48,14 +49,14 @@ const WorkspaceDelete = ({ position }: WorkspaceDeleteProps) => { | |||
|
|||
closeModal(); | |||
|
|||
localStorage.removeItem('teamId'); | |||
localStorage.removeItem(STORAGE_KEY.TEAM_ID); | |||
localStorage.removeItem(STORAGE_KEY.TEAM_NAME); | |||
|
|||
navigate(PATH.DASHBOARD); | |||
window.location.reload(); |
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.
그러게요 대쉬보드로만 돌아가면 되지 않나용?
@@ -55,9 +55,9 @@ const InvitedPage = () => { | |||
{ | |||
onSuccess: () => { | |||
createToast('초대 승인에 성공하셨습니다.', 'success'); | |||
window.location.replace(PATH.DASHBOARD); |
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.
혹시 값이 변한게 안반영되어서 window.location을 navigate 대신에 사용한거라면 invalidquries를 사용해서 값을 리패치해주는건 어떨까요?
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.
고생하셧슴다 !!~
navigate(PATH.DASHBOARD); | ||
}, | ||
onError: (error: components['schemas']['ErrorResponse']) => { | ||
deleteLocalStorageInviteInfo(); | ||
createToast(error.message, 'error'); | ||
createToast(`초대 승인에 실패하셨습니다: ${error.message}`, 'error'); |
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.
요거 error
타입 뮤에이트 함수에서 axios
사용하고 있다면 axiosError
타입일 것 같은데 ?? 아닌가유
localStorage.setItem(STORAGE_KEY.TEAM_NAME, firstTeam.name); | ||
navigate(PATH.DASHBOARD); | ||
} | ||
}, [firstTeam, navigate]); |
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.
오 ! 될거같다 !
@@ -19,7 +19,7 @@ export const authMiddleware: Middleware = { | |||
async onRequest({ request }) { | |||
const accessToken = localStorage.getItem(STORAGE_KEY.ACCESS_TOKEN_KEY); | |||
|
|||
if (!accessToken) { | |||
if (!accessToken && !localStorage.getItem(STORAGE_KEY.INVITATION_ID)) { |
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.
요거 왜 ?? 추가하신건지 설명해주세용 ..
아 그리고 둘 다 isNil
사용해주세용 !
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.
액세스 토큰이 없을때 초대를 받으면 로그인 화면으로 이동되더라구요.
그래서 액세스 토큰이 없어도 초대 아이디가 있다면 로그인페이지로 이동하지 않도록 막은 것입니다!
액세스 토큰과 초대 아이디가 모두 없을 때 로그인 페이지로 이동하게끔했습니다.
eda08a0
to
31202cc
Compare
b6055f2
to
8e7a5c5
Compare
해당 이슈 번호
closed #463
체크리스트
📌 내가 알게 된 부분
navigate는 진짜 경로만 옮겨주는데요 window.location.replace는 새로고침까지 해줘요!
그래서 바뀐 것들이 반영이 아주 잘된답니다 😄
💎 PR Point
cal(100vh - 어쩌구)
로 반응형으로 해결할 수 있었습니다.middleware.ts
에서 토큰여부확인하는 로직을 수정했습니다.accessToken
만 없으면 바로 로그인페이지로 이동하게 되어있었는데,📌스크린샷 (선택)