-
Notifications
You must be signed in to change notification settings - Fork 4
[Refactor] 로그인 유무에 따른 에러 처리와 응답 반환 #321
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
[Refactor] 로그인 유무에 따른 에러 처리와 응답 반환 #321
Conversation
yiseungyun
left a comment
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.
고수.의향이 가득.나네요. 본받고싶어요. 👍👍👍
수고 많으셨습니다!
blu3fishez
left a comment
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.
수고하셨습니당! 다 좋은데 만약에 혹시라도 하시면서 노가다하는 느낌이 드셨으면 모듈화가 필요하신거라고 생각합니다
| const isScrap = userId | ||
| ? await this.questionListRepository.isQuestionListScrapped(id, userId) | ||
| : false; | ||
|
|
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.
타입 지정할 때 userId?: number 하시면 안받을수도 받을 수도 있습니당!@!
| return { | ||
| return res.status(HttpStatus.OK).json({ | ||
| success: true, | ||
| message: "Question list unscrapped successfully.", | ||
| }; | ||
| }); | ||
| } else { | ||
| return { | ||
| return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json({ | ||
| success: false, | ||
| message: "Failed to unscrap question list.", | ||
| }; | ||
| }); | ||
| } | ||
| } catch (error) { | ||
| return { | ||
| return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json({ | ||
| success: false, | ||
| message: "Failed to unscrap question list.", | ||
| error: error.message, | ||
| }; | ||
| }); |
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.
모두 똑같은 방식으로 노가다 힘드셨을 것 같습니다..
노가다..? 노가다..? 어...? 반복되는걸 어떻게 해봐야할지 생각해보시면 좋을 것 같습니다~
ShipFriend0516
left a comment
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.
이 내용을 적용해야겠네요 고생하셧씁니다
| isScrap, | ||
| scrapCount: parseInt(scrapCount.count), |
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.
좋습니당
| return res.status(HttpStatus.UNAUTHORIZED).json({ | ||
| success: false, | ||
| message: "Login required.", | ||
| }); | ||
|
|
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.
오 이제 401에러로 잘 나오나요?
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.
넴 맞습니당~!
Note
✅ 체크리스트
🧩 작업 내용
isScrap: booleanscrapCount: booleanfalse반환📝 작업 상세 내역
모든 API 응답에 적절한 상태 코드 반환
로그인 유무에 따라 적절한 응답 반환
isScrap,scrapCount데이터를 반환할 수 있도록 구현했습니다.질문지 작성자 관련 에러 fix
username에 나의username을 반환하는 에러가 있었습니다.username을 반환하도록 수정했습니다.📌 테스트 및 검증 결과
💬 다음 작업 또는 논의 사항