mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 00:31:25 +10:00
* feat: add readDropValidatedBody w/ special handler for ArkErrors * fix: lint
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { type } from "arktype";
|
||||
import { throwingArktype } from "~/server/arktype";
|
||||
import { readDropValidatedBody, throwingArktype } from "~/server/arktype";
|
||||
import aclManager from "~/server/internal/acls";
|
||||
import prisma from "~/server/internal/db/database";
|
||||
|
||||
@ -15,7 +15,7 @@ export default defineEventHandler<{
|
||||
]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const body = await readValidatedBody(h3, DeleteInvite);
|
||||
const body = await readDropValidatedBody(h3, DeleteInvite);
|
||||
|
||||
await prisma.invitation.delete({ where: { id: body.id } });
|
||||
return {};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { type } from "arktype";
|
||||
import { throwingArktype } from "~/server/arktype";
|
||||
import { readDropValidatedBody, throwingArktype } from "~/server/arktype";
|
||||
import aclManager from "~/server/internal/acls";
|
||||
import prisma from "~/server/internal/db/database";
|
||||
|
||||
@ -18,7 +18,7 @@ export default defineEventHandler<{
|
||||
]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const body = await readValidatedBody(h3, CreateInvite);
|
||||
const body = await readDropValidatedBody(h3, CreateInvite);
|
||||
|
||||
const invitation = await prisma.invitation.create({
|
||||
data: body,
|
||||
|
||||
Reference in New Issue
Block a user