fix: refactoring and ordering data on agent and project page

This commit is contained in:
charles-gauthereau
2026-06-07 17:33:47 +02:00
parent ae431f5b85
commit 2e629f8423
3 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -117,7 +117,9 @@ export const AgentContentPage = ({edgeKey, agent: initialAgent}: AgentContentPag
<CardsWithPagination
cardsPerPage={4}
numberOfColumns={2}
data={agent.databases}
data={[...agent.databases].sort((a, b) =>
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
)}
cardItem={AgentDatabaseCard}
/>
</div>
+1 -1
View File
@@ -2,7 +2,7 @@
import {action, ActionError, userAction} from "@/lib/safe-actions/actions";
import {AgentSchema} from "@/features/agents/agents.schema";
import {z} from "zod";
import {eq, and, ne, count} from "drizzle-orm";
import {eq, and, ne, count, desc} from "drizzle-orm";
import {db} from "@/db";
import * as drizzleDb from "@/db";
import {slugify} from "@/utils/slugify";