Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix: simplify sorting logic in handleList function
nirholas3211a55373e5
diff --git a/api/plugins/[action].js b/api/plugins/[action].jsindex c1b12d328..70cbe8690 100644--- a/api/plugins/[action].js+++ b/api/plugins/[action].js@@ -136,6 +136,13 @@ async function handleList(req, res, url) {const limit = Math.min(40, Math.max(1, Number(url.searchParams.get('limit')) || 20));const offset = cursor ? Math.max(0, Number(cursor)) : 0;+ const sortClause =+ sort === 'popular'+ ? 'p.install_count DESC, p.created_at DESC'+ : sort === 'new'+ ? 'p.created_at DESC'+ : 'p.name ASC';+const rows = await sql`SELECT p.*, u.display_name AS author_display_nameFROM plugins p@@ -144,13 +151,7 @@ async function handleList(req, res, url) {AND p.deleted_at IS NULL${category ? sql`AND p.category = ${category}` : sql``}${q ? sql`AND (p.name ILIKE ${'%' + q + '%'} OR p.description ILIKE ${'%' + q + '%'})` : sql``}- ORDER BY ${sql.unsafe(- sort === 'popular'- ? 'p.install_count DESC, p.created_at DESC'- : sort === 'new'- ? 'p.created_at DESC'- : 'p.name ASC',- )}+ ORDER BY ${sql.unsafe(sortClause)}LIMIT ${limit + 1} OFFSET ${offset}`;