Skip to content

Commit

Permalink
Merge: 네이버 소셜로그인 url 추가
Browse files Browse the repository at this point in the history
[Fix/message ordering] 네이버 소셜로그인 url 추가
  • Loading branch information
yyysolhhh authored May 30, 2024
2 parents 8bfdad3 + f60f6e0 commit 3a062a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions apps/chat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,13 @@ def get_chatroom_message(chatroom_id: int) -> Any:
# 디비에 저장된 메시지가 30-stored_message_num 보다 많으면 슬라이싱해서 필요한 만큼의 데이터를 가져옴
if len(db_messages) >= 30 - stored_message_num:
serialized_messages = MessageSerializer(db_messages[: 30 - stored_message_num], many=True).data
return messages + serialized_messages
serialized_message_list = [serialized_messages]
return messages + serialized_message_list

# 디비에 저장된 메시지가 30-stored_message_num 보다 적으면 db에 저장된 채팅방의 모든 메시지를 가져옴
serialized_messages = MessageSerializer(db_messages, many=True).data
return messages + serialized_messages
serialized_message_list = [serialized_messages]
return messages + serialized_message_list

# 레디스에 해당 채팅방 그룹 네임으로 지정된 키값이 없으면 데이터베이스에서 채팅 메시지를 가져옴
db_messages = Message.objects.filter(chatroom_id=chatroom_id)
Expand Down
3 changes: 2 additions & 1 deletion apps/user/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
DeleteUserView,
GoogleLoginView,
KakaoLoginView,
SendCodeView,
SendCodeView, NaverLoginView,
)

# from apps.user.views import CustomConfirmEmailView
Expand All @@ -36,6 +36,7 @@
path("login/", CustomLoginView.as_view(), name="login"),
path("login/social/kakao/", KakaoLoginView.as_view(), name="kakao_login"),
path("login/social/google/", GoogleLoginView.as_view(), name="google_login"),
path("login/social/naver/", NaverLoginView.as_view(), name="naver_login"),
path("logout/", LogoutView.as_view(), name="rest_logout"),
path("detail/", UserDetailsView.as_view(), name="rest_user_details"),
path("leave/", DeleteUserView.as_view(), name="delete-user"),
Expand Down

0 comments on commit 3a062a3

Please sign in to comment.