Skip to content
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

Bookmark Delete API #6

Open
jseop-lim opened this issue Apr 27, 2022 · 1 comment
Open

Bookmark Delete API #6

jseop-lim opened this issue Apr 27, 2022 · 1 comment

Comments

@jseop-lim
Copy link
Collaborator

jseop-lim commented Apr 27, 2022

문제

사용자의 관심상품 화면에서 빨간 하트를 클릭하면 북마크 삭제 API로 연결된다.
북마크 삭제 API의 uri는 어떻게 구성해야 하나?

방안

  1. DELETE /bookmark/<bookmark_id>
  2. DELETE /users/<user_id>/bookmark/<bookmark_id>

첫번째가 더 RESTful에 가까워보인다.

@jseop-lim
Copy link
Collaborator Author

user_id 입력 방식

  • API 호출 시 client에서 직접 user_id를 POST 방식으로 전달하기
  • request로부터 user 추출하여 view에서 입력하기

프론트엔드와 협의하여 결정

jseop-lim added a commit that referenced this issue May 1, 2022
Bookmark 인스턴스 생성, 삭제 API
(serializer) BookmarkSerializer 정의
(view) CBV로 BookmarkCreateView, BookmarkDestroyView 정의
(url) 'bookmark-list', 'bookmark-detail' 추가

(#6, #8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant