diff --git a/backend/core/views.py b/backend/core/views.py index 7e72be0..65b49dc 100644 --- a/backend/core/views.py +++ b/backend/core/views.py @@ -442,6 +442,8 @@ def get_queryset(self): if parentId: queryset = queryset.filter(parentId=parentId) + queryset = queryset.order_by("-created") + return queryset def perform_create(self, serializer): diff --git a/frontend/app/_components/list.tsx b/frontend/app/_components/list.tsx index 8a6f37e..c6bf5c0 100644 --- a/frontend/app/_components/list.tsx +++ b/frontend/app/_components/list.tsx @@ -10,13 +10,7 @@ export default function List({ styles, className, layoutClassName, -}: type.ListProps) { - const sortedItems = [...items].sort((a, b) => { - if (a.updated && b.updated) { - return new Date(b.updated).getTime() - new Date(a.updated).getTime() - } - return 0 // Keep the items order unchanged if "updated" is missing - }) +}: type.ListProps) { return (
    ({ }} className={className} > - {sortedItems.map((item) => ( + {items.map((item) => ( ))}