WorkshopTasker/server/api/clients.get.ts

11 lines
395 B
TypeScript
Raw Permalink Normal View History

import { defineEventHandler } from "h3";
2023-05-11 06:03:22 +02:00
import getPaginatedParameters from "../utils/baaPageParsing";
import { database } from "../utils/database";
import { prismaToWeb } from "~/server/utils/prismaToWeb";
2023-05-11 06:03:22 +02:00
2023-05-11 09:11:20 +02:00
export default defineEventHandler((e) => {
const pageParameters = getPaginatedParameters(e, 50, 200);
return database.client.findPaginated(pageParameters, {}).then(prismaToWeb);
2023-05-11 06:03:22 +02:00
});