Skip to content

Conversation

@fivedasol
Copy link
Contributor

Related issue 🚀

  • closed #{이슈_번호}

Work Description 💚

  • 유저 이름 변경 기능 추가 및 리팩토링

PR 참고 사항

  • 프로필 사진 변경이랑 이름 변경하는걸 같은 api로 묶어서 "유저 정보 변경" 으로 만들었습니다!
  • 이 과정에서 기본프로필로 변경을 POST로, 유저 정보 변경을 PATCH로 메서드만 바꿔주었어요 (이게 더 맞는거 같아서요..!)
  • 그리고 url 이름도 api 기능에 맞게 조금 변경했습니다

path('logout/', LogoutAPIView.as_view(), name='logout'), # 로그아웃
path('profile-image/update', ProfileAPIView.as_view(), name='profile-image-update'), # 프로필 사진 업로드 (post)
path('profile-image/reset', ProfileAPIView.as_view(), name='profile-image-reset'), # 프로필 기본 이미지로 변경 (patch)
path('profile/update', ProfileAPIView.as_view(), name='profile-update'), # 프로필 수정 (patch)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

profile에서 이름과 사진을 모두 변경 가능한 api여서 url 이름을 바꿔주었습니다

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변경한 이름이 맞는거 같슴다

path('profile-image/update', ProfileAPIView.as_view(), name='profile-image-update'), # 프로필 사진 업로드 (post)
path('profile-image/reset', ProfileAPIView.as_view(), name='profile-image-reset'), # 프로필 기본 이미지로 변경 (patch)
path('profile/update', ProfileAPIView.as_view(), name='profile-update'), # 프로필 수정 (patch)
path('profile/image-reset', ProfileAPIView.as_view(), name='profile-image-reset'), # 프로필 기본 이미지로 변경 (post)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

profile이라는걸로 하나 묶고 /image-reset하는게 더 보기 편할거 같아서 변경해주었어요!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 그냥 하나의 url로 해도 괜찮지 않나요? POST/ GET/PATCH 사용하는거 같은데.. 뭔가 구분하기 어려울라나?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 그렇네요.. 어떻게 할까요..? 하나로 해야 swagger에도 여러개로 안나올거 같은데 프론트에서만 잘 구별만 해준다면..
swagger를 보면서 한다면 3개를 하나로 (profile) 묶어도 괜찮을거 같아요
그렇게 수정할까요?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇게 하시죠!
아니 근데 왜 안나오지

@fivedasol fivedasol merged commit 949eee4 into main Feb 22, 2025
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

Successfully merging this pull request may close these issues.

3 participants