From 36736798a3699623f7c0ec4f17523859f330ff31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B0=D1=85=D0=B0=D1=80=D0=BE=D0=B2=20=D0=98=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=20=D0=9C=D0=B8=D1=85=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D0=B8=D1=87?= Date: Mon, 16 Dec 2024 14:13:31 +0000 Subject: [PATCH] sort reverse --- rating_api/routes/comment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rating_api/routes/comment.py b/rating_api/routes/comment.py index b228216..6754b03 100644 --- a/rating_api/routes/comment.py +++ b/rating_api/routes/comment.py @@ -147,7 +147,7 @@ async def get_comments( result.comments = result.comments[offset : limit + offset] if "create_ts" in order_by: - result.comments.sort(key=lambda comment: comment.create_ts) + result.comments.sort(key=lambda comment: comment.create_ts, reverse=True) result.total = len(result.comments) result.comments = [CommentGet.model_validate(comment) for comment in result.comments] return result