Login-text, Context menu QoL enhancements

This commit is contained in:
PxlLoewe
2025-07-07 04:06:02 -07:00
parent 79b26be39a
commit 413be72eca
8 changed files with 43 additions and 20 deletions

View File

@@ -11,6 +11,7 @@ export async function getData(
filter?: Record<string, any>,
include?: Record<string, boolean>,
orderBy?: Record<string, "asc" | "desc">,
select?: Record<string, any>,
) {
if (!model || !prisma[model]) {
return { data: [], total: 0 };
@@ -33,13 +34,13 @@ export async function getData(
if (!prisma[model]) {
return { data: [], total: 0 };
}
const data = await (prisma[model] as any).findMany({
where,
orderBy,
take: limit,
skip: offset,
include,
select,
});
const total = await (prisma[model] as any).count({ where });