style: run prettier on entire codebase

This commit is contained in:
BOHA
2026-03-24 19:59:14 +01:00
parent 872be42107
commit 3c167cf5c4
148 changed files with 26740 additions and 13990 deletions

View File

@@ -1,12 +1,17 @@
import { ZodSchema, z } from 'zod';
import { ZodSchema, z } from "zod";
export function parseBody<T>(schema: ZodSchema<T>, body: unknown): { data: T } | { error: string } {
export function parseBody<T>(
schema: ZodSchema<T>,
body: unknown,
): { data: T } | { error: string } {
try {
return { data: schema.parse(body) };
} catch (e) {
if (e instanceof z.ZodError) {
return { error: e.issues.map((err: z.ZodIssue) => err.message).join(', ') };
return {
error: e.issues.map((err: z.ZodIssue) => err.message).join(", "),
};
}
return { error: 'Neplatný požadavek' };
return { error: "Neplatný požadavek" };
}
}