-
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
[BE/#134] GET /posts/block API 구현 #139
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- isExist.status === true 이렇게 쓰면 존재하지 않는 경우인 null에 대해 검사 할 때 에러가 나기에 null검사 로직 추가
namewhat99
approved these changes
Nov 23, 2023
@@ -14,10 +14,10 @@ export class BlockPostEntity { | |||
status: boolean; | |||
|
|||
@ManyToOne(() => UserEntity, (blocker) => blocker.user_hash) | |||
@JoinColumn({ name: 'blocker' }) | |||
@JoinColumn({ name: 'blocker', referencedColumnName: 'user_hash' }) |
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.
refereceColumn 적용 좋습니다~
|
||
@Get() | ||
async postsBlockList() { | ||
const blockerId: string = 'qwe'; |
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.
추후에 로그인 구현 이후에 이 부분 같이 바꿉시다~
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
이슈
체크리스트
고민한 내용
null 들어오면 오류 나는 이슈
isExist.status === true
에서 isExist 에서 존재 하지 않으면 null 반환되고 null.status는 null이라고 생각하여 이렇게 구현했었는데 null에 프로퍼티를 찾는 연산을 하면 에러가 떴다.그래서 null이면 조건문을 통과하도록 수정하였다.
Join 에러
엔티티를 정확하게 작성하지 않아 join이 되지 않는 오류가 발생하였다. 엔티티의 join 관계를 정확히 수정하니 정상적으로 작동하였다.
thumbnail
차단된 게시글의 내용과 게시글의 첫번째 사진을 반환해야했는데 사진을 또 찾으려면 3중 조인을 해야해서 비효율적이라 생각이 들어 게시글을 저장 할 떄 첫번째 사진은 게시글 테이블 안에 저장하도록 수정했다.
스크린샷