image library changes, bit flags changes
This commit is contained in:
@@ -4,6 +4,9 @@ import { z } from "zod";
|
||||
import type { HonoEnv } from "./types.ts";
|
||||
import { ZodSchema } from "zod/v4";
|
||||
import { HTTPStatus } from "@oneday/http-status";
|
||||
import Logging from "@proxnet/undead-logging";
|
||||
|
||||
const log = new Logging("Validation");
|
||||
|
||||
// thanks claude, this hurt my brain!
|
||||
|
||||
@@ -17,7 +20,10 @@ export const typedZValidator = <
|
||||
recNetError?: string
|
||||
) => {
|
||||
return zValidator(target, schema, (result, c) => {
|
||||
|
||||
if (!result.success) {
|
||||
log.w(`Validation failed: ${JSON.stringify(result.error)}`);
|
||||
|
||||
if (recNetError) return c.json({ success: false, error: recNetError }, httpOk == true ? HTTPStatus.OK : HTTPStatus.BadRequest);
|
||||
else return c.json({ success: false, error: "Request validation failed" }, httpOk == true ? HTTPStatus.OK : HTTPStatus.BadRequest);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user