You've already forked Promocode-API
mirror of
https://github.com/devitq/Promocode-API.git
synced 2026-05-22 23:17:10 +00:00
feat: added comments sort
This commit is contained in:
@@ -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