-
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
[Feat] : Auth #8
Comments
유저와 게시물 데이터의 관계 형성을 위해 서로 간의 엔티티에 필드를 넣어줘야 한다. 일 대 다 : OneToMany( 타입, 상대, 옵션 ) 보드 여러 개가 무조건 하나의 유저 ( 작성자 ) 를 가지고 있다. OneToMany |
로그인하면 AccessToken이 발급된다. 그걸 Bearer Token 으로 넣은 상태로 새로운 board 를 post 하면 그 게시물에 작성자 아이디가 넣어진다. |
해당 유저의 게시물을 찾기 위한 쿼리 빌더 사용하기 |
삭제를 할 때, 유저 객체를 인자로 넘겨야되는데 또 지원을 안 해준단다. 그래서 두 가지 방법이 있는데 |
const result = await this.boardRepository.createQueryBuilder('board')
.delete()
.from(Board)
.where("userId = :userId", { userId: user.id})
.andWhere( "id = :id", { id: id } ).execute(); |
다음 이슈는 로그다! |
The text was updated successfully, but these errors were encountered: