2023-11-08 05:35:48 +01:00
|
|
|
import { defineEventHandler } from "h3";
|
2023-05-11 06:03:22 +02:00
|
|
|
|
2023-11-08 05:35:48 +01: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) => {
|
2023-11-08 05:35:48 +01:00
|
|
|
const pageParameters = getPaginatedParameters(e, 50, 200);
|
|
|
|
return database.client.findPaginated(pageParameters, {}).then(prismaToWeb);
|
2023-05-11 06:03:22 +02:00
|
|
|
});
|