mirror of
https://github.com/devitq/Promocode-API.git
synced 2026-11-20 16:47:44 +00:00
feat: added comments sort
This commit is contained in:
1 parent
d8c18cee78
commit
43baa2af5c
1 file changed
+1
-1
@@ -324,7 +324,7 @@ def list_comments(
|
|||||||
|
|
||||||
promocodes = promocodes.prefetch_related("comments", "comments__author")
|
promocodes = promocodes.prefetch_related("comments", "comments__author")
|
||||||
|
|
||||||
comments = promocodes.first().comments.all()
|
comments = promocodes.first().comments.order_by("-date").all()
|
||||||
|
|
||||||
response["X-Total-Count"] = len(comments)
|
response["X-Total-Count"] = len(comments)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user