Replace mysql2 with prisma
also I updated packages, and properly typed api input a lot of time was spent, I don't remeber what really I did x3 but everything was related to replacing mysql2 with prisma
This commit is contained in:
parent
be1e3909b6
commit
eebf25198d
39 changed files with 1081 additions and 1292 deletions
|
@ -1,9 +1,16 @@
|
|||
import { defineEventHandler } from "h3";
|
||||
|
||||
import { baaWrapper } from "~/server/api/orders.get";
|
||||
import { getOrders } from "~/server/api/orders.get";
|
||||
import { prismaToWeb } from "~/server/utils/prismaToWeb";
|
||||
import getPaginatedParameters from "~/server/utils/baaPageParsing";
|
||||
|
||||
export default defineEventHandler(async (e) => {
|
||||
const baa = await baaWrapper.RESTget(e, 50, 200, "`client` = ?", [e.context.params?.id]);
|
||||
console.log(baa);
|
||||
return baa;
|
||||
export default defineEventHandler((e) => {
|
||||
const pageParameters = getPaginatedParameters(e, 50, 200);
|
||||
const clientId = e.context.params?.id as string;
|
||||
return getOrders(
|
||||
pageParameters,
|
||||
{
|
||||
clientId: BigInt(clientId),
|
||||
},
|
||||
).then(prismaToWeb);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue