-
Notifications
You must be signed in to change notification settings - Fork 0
엔티티 리팩터링 갈무리 #25
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
엔티티 리팩터링 갈무리 #25
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.
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
src/modules/problem/service.ts
Outdated
@@ -40,7 +40,7 @@ export class ProblemService { | |||
.then((res) => res.data); | |||
|
|||
for (const problem of response['items']) { | |||
problems.push(new Problem(problem)); | |||
problems.push(problem); |
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.
Removing the instantiation (i.e., new Problem(problem)) may lead to inconsistent behavior if consumers expect an instance with methods defined on the Problem class. Consider converting the raw problem object to a Problem instance using Problem.fromDocument or the appropriate constructor.
problems.push(problem); | |
problems.push(new Problem(problem)); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
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.
validate(id: string, poker: Poker): void { | ||
if (!poker) { | ||
async update(id: string, poker: Poker): Promise<Poker> { | ||
const pokerDoc = await this.pokerModel.findByIdAndUpdate(id, poker); |
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.
findByIdAndUpdate by default returns the pre-update document. Consider adding the option { new: true } to return the updated document, ensuring that Poker.fromDocument reflects the latest changes.
const pokerDoc = await this.pokerModel.findByIdAndUpdate(id, poker); | |
const pokerDoc = await this.pokerModel.findByIdAndUpdate(id, poker, { new: true }); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
업데이트 유형
업데이트 개요
엔티티 구조가 완전하지 않았음
해당 구조 리팩터링에 집중
업데이트 요약
수정 사항 진단