Custom readValidatedBody util to return more specific error #69 (#78)

* feat: add readDropValidatedBody w/ special handler for ArkErrors

* fix: lint
This commit is contained in:
DecDuck
2025-06-03 17:40:41 +10:00
committed by GitHub
parent f264fd0971
commit 4f8ea3e4ff
11 changed files with 43 additions and 19 deletions

View File

@ -1,4 +1,5 @@
import { type } from "arktype";
import { readDropValidatedBody } from "~/server/arktype";
import aclManager from "~/server/internal/acls";
import prisma from "~/server/internal/db/database";
import libraryManager from "~/server/internal/library";
@ -33,7 +34,7 @@ export default defineEventHandler(async (h3) => {
onlySetup,
delta,
umuId,
} = await readValidatedBody(h3, ImportVersion);
} = await readDropValidatedBody(h3, ImportVersion);
const platformParsed = parsePlatform(platform);
if (!platformParsed)