-
Notifications
You must be signed in to change notification settings - Fork 0
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
[NDD-172]: 카테고리 삭제 기능 구현 (2h / 1h) #54
Conversation
Deploying with Cloudflare Pages
|
@@ -0,0 +1,2 @@ | |||
export const objectEquals = (obj1: object, obj2: object) => | |||
Object.entries(obj1).toString() === Object.entries(obj2).toString(); |
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.
이거 테스트할 때 제외하면 사용할 일이 있을까요? 테스트만을 위해 사용할꺼라면 util.ts가 아니라 test.util.ts는 어떨까요?
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.
테스트용이 아닌, 카테고리에서 회원 객체를 가져올 때, jwt를 통해 가져온 회원과 비교하는 프로덕션 코드입니다!
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.
앗 그런거였나요???! 제가 코드를 잘못봤나보네요! 알겠습니다!!
import { CreateCategoryRequest } from '../dto/createCategoryRequest'; | ||
|
||
@Entity({ name: 'Category' }) | ||
export class Category extends DefaultEntity { | ||
@Column() | ||
name: string; | ||
|
||
@ManyToOne(() => Member, { nullable: true, onDelete: 'CASCADE' }) | ||
@ManyToOne(() => Member, { nullable: true, onDelete: 'CASCADE', eager: true }) |
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.
카테고리를 불러올 때 거의 대부분의 경우에 Member도 같이 불러오나요??
eager를 여기에서 왜 사용하셨는지 이유가 궁금합니다!
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.
eager를 통해서 Member를 가져옵니다. 등록되지 않았을 때 Member가 조회되지 않는 문제가 있었습니다.
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.
LGTM 2주차도 고생하셨습니다 장희님!
Why
기획상의 추가사항 : 회원이 보고 싶지 않은 카테고리를 삭제해야 한다.
이를 적용하기 위해 카테고리를 삭제하는 기능을 만들었다.
How
카테고리 삭제시에, 카테고리 내의 질문들 또한 같이 삭제하게 추후에 구현해야 한다. (Question 구현시에 추가 예정)
삭제 시에 권한 확인을 해야한다.
Result