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

comment_list #143

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/articles/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class Meta:
"updated_at",
"thumbnail_image",
]
ordering = ["created_at"]


def get_user(self, obj):
user = obj.user
Expand Down
3 changes: 3 additions & 0 deletions api/comments/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class Meta:
"created_at",
"updated_at",
]


def get_user_profile_image(self, obj):
profile = obj.user.profile
Expand Down Expand Up @@ -169,6 +170,7 @@ class Meta:
"created_at",
"updated_at",
]


def get_user_profile_image(self, obj):
profile = obj.user.profile
Expand Down Expand Up @@ -227,6 +229,7 @@ class Meta:
"created_at",
"updated_at",
]



# νŠΉμ • λŒ“κΈ€ 쑰회 μ‹œλ¦¬μ–ΌλΌμ΄μ €
Expand Down
6 changes: 1 addition & 5 deletions api/comments/views/comment_crud_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from rest_framework.exceptions import PermissionDenied
from rest_framework.parsers import FormParser, MultiPartParser


from ..models import Comment, CommentImage
from ..s3instance import S3Instance
from ..serializers import (
Expand Down Expand Up @@ -86,7 +85,7 @@ class CommentListView(generics.ListAPIView):

def get_queryset(self):
article_id = self.kwargs["article_id"]
return Comment.objects.filter(article_id=article_id)
return Comment.objects.filter(article_id=article_id).order_by("created_at")


# λŒ“κΈ€ 상세 쑰회 λ·°
Expand All @@ -101,6 +100,3 @@ def get_queryset(self):
def get_object(self):
comment = super().get_object()
return comment



2 changes: 2 additions & 0 deletions api/users/views/user_auth_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def create(self, request, *args, **kwargs):
[user.email],
)

# jwt_tokens = GeneralAuthClass.set_auth_tokens_for_user(user)

response = Response(
{
"username": user.username,
Expand Down
Loading
Loading