replace old error formatting with zod format error

This commit is contained in:
miloschwartz 2025-03-31 22:37:39 -04:00
parent 6204fa0ade
commit 80ef8f189e
No known key found for this signature in database
7 changed files with 17 additions and 10 deletions

View file

@ -16,6 +16,7 @@ import response from "@server/lib/response";
import HttpCode from "@server/types/HttpCode";
import createHttpError from "http-errors";
import logger from "@server/logger";
import { fromZodError } from "zod-validation-error";
const getOrgParamsSchema = z
.object({
@ -45,7 +46,7 @@ export async function getOrgOverview(
return next(
createHttpError(
HttpCode.BAD_REQUEST,
parsedParams.error.errors.map((e) => e.message).join(", ")
fromZodError(parsedParams.error)
)
);
}