Skip to content

[Feedback]: 로직 피드백 및 주석 추가#62

Open
joseph0926 wants to merge 1 commit into
feature/QFEED-108from
feedback
Open

[Feedback]: 로직 피드백 및 주석 추가#62
joseph0926 wants to merge 1 commit into
feature/QFEED-108from
feedback

Conversation

@joseph0926
Copy link
Copy Markdown

** #61 에서 파생된 브렌치입니다 **
이후 develop으로 변경 예정입니다.

🗒️ Describe your changes

2024.12.06: 01 - auth 로직 피드백

✅ PR CheckList

PR에 어떤 작업사항들이 반영됐는지 확인해주세요

  • 주석 추가

📸 ScreenShots

스크린 샷을 첨부해 주세요 (선택)

🤔 To Reviewers

@joseph0926 joseph0926 self-assigned this Dec 6, 2024
@joseph0926 joseph0926 marked this pull request as draft December 6, 2024 03:16
Comment thread src/main.tsx
import { BottomNavigationStyleConfig as BottomNavigation } from 'chakra-ui-bottom-navigation';

// [May]: 여기 정의해두셔도 괜찮지만, 따로 파일 분리해도 좋을거같습니다..!
const queryClient = new QueryClient({
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider moving the definition of queryClient to a separate file. This will help in maintaining the code and improving readability.

Comment thread src/main.tsx
});

// [May]: 여기 정의해두셔도 괜찮지만, 따로 파일 분리해도 좋을거같습니다..!
const chakraTheme = extendTheme({
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It would be better to separate the chakraTheme into a different file for better code organization and readability.

mutationFn: createAnswer,
onSuccess: (data) => {
console.log('Answer created successfully:', data);
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoid using console.log in production code. If you need to log the success message, consider using a logging library that can be toggled for production or development environments.

},
// [Should] 단순히 로그를 찍는것보다 회원가입 / 로그인 페이지로 리다이렉트 시켜주는게 사용자 경험에 더 좋을거같습니다
onError: (error) => {
console.error('Failed to create answer:', error);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoid using console.error in production code. Consider using a more user-friendly way to display errors, such as a toast notification or a message in the UI.

// [Should] 단순히 로그를 찍는것보다 회원가입 / 로그인 페이지로 리다이렉트 시켜주는게 사용자 경험에 더 좋을거같습니다
onError: (error) => {
console.error('Failed to create answer:', error);
navigate('/login');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It might not be appropriate to always redirect to the login page when an error occurs. The error could be due to other reasons, not necessarily because the user is not logged in. Consider handling different types of errors differently.

return;
}

// [Question] 백엔드랑 합의된 로그인 / 회원가입 유효성 검사가 존재하나요?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoid adding questions or suggestions as comments in the code. Instead, consider discussing these points with your team or through the PR comments section.

// 현재 비밀번호 유효성 검사에 실패하여 회원가입이 실패되는데, 유저 입장에서는 무었때문에 거절 당한지 알수가없습니다

// 모든 조건이 충족되면 로컬스토리지에 저장
localStorage.setItem('registerEmail', data.email);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Storing sensitive information like passwords in local storage is not secure. Consider using more secure methods to handle passwords.

@ahnjongin ahnjongin marked this pull request as ready for review December 6, 2024 05:08
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.

1 participant