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

feature(web): survey데이터 호출 #5

Open
wants to merge 1 commit into
base: style/admin
Choose a base branch
from

Conversation

Ssoon-m
Copy link
Collaborator

@Ssoon-m Ssoon-m commented Mar 2, 2024

작업한 내용

  • survey데이터 호출을 위한 작업

Comment on lines +97 to +105
getSurvey(supabase)
.then((data) => {
setData(data);
setIsLoading(false);
})
.catch(() => {
setIsError(true);
setIsLoading(false);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2: getSurvey는 async await을 사용하신반면, 여기는 Promise를 사용하셨는데요 통일하는게 좋지 않을까요?
그리고, useQuery에서 getSurvey를 불러오게도 사용하실 수 있을 것 같아요 react-query를 사용하시면 에러처리를 suspense로 할 수 있는등의 이점이 있습니다

Comment on lines +20 to +26
if (isError) {
return <div>error</div>;
}

if (isLoading) {
return <div>loading...</div>;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2: https://tech.kakaopay.com/post/react-query-2/ 여기 부분들도 Suspense도입과 에러처리 같이 해주시고,
추가로 Sentry 도입도 같이되어서 에러추적할 수 있게 설계해보시면 좋을 것 같습니다

@leeyun1533
Copy link

요 PR에서 언급된 Suspense와 Errorboundary는 이해하고 도입 꼭 해주세요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants