Login-text, Context menu QoL enhancements
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user