Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
total count
Browse files
src/routes/api/models/+server.ts
CHANGED
@@ -84,9 +84,19 @@ export async function GET(request : RequestEvent) {
|
|
84 |
take: limit,
|
85 |
})
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
return json({
|
88 |
cards,
|
89 |
-
total_items:
|
90 |
})
|
91 |
}
|
92 |
|
|
|
84 |
take: limit,
|
85 |
})
|
86 |
|
87 |
+
const total_reposId = await prisma.model.count({
|
88 |
+
where: {
|
89 |
+
...(IS_ADMIN ? {} : { isPublic: true }),
|
90 |
+
...(base_model_mapped ? { base_model: { in: base_model_mapped } } : {}),
|
91 |
+
OR: [
|
92 |
+
{ id: { contains: search } },
|
93 |
+
]
|
94 |
+
},
|
95 |
+
})
|
96 |
+
|
97 |
return json({
|
98 |
cards,
|
99 |
+
total_items: total_reposId
|
100 |
})
|
101 |
}
|
102 |
|