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
7 changed files with 17 additions and 10 deletions

View File

@@ -14,6 +14,7 @@ import createHttpError from "http-errors";
import { sql, eq, or, inArray, and, count, isNull, lt, gt } from "drizzle-orm";
import logger from "@server/logger";
import stoi from "@server/lib/stoi";
import { fromZodError } from "zod-validation-error";
const listAccessTokensParamsSchema = z
.object({
@@ -133,7 +134,7 @@ export async function listAccessTokens(
return next(
createHttpError(
HttpCode.BAD_REQUEST,
parsedQuery.error.errors.map((e) => e.message).join(", ")
fromZodError(parsedQuery.error)
)
);
}
@@ -144,7 +145,7 @@ export async function listAccessTokens(
return next(
createHttpError(
HttpCode.BAD_REQUEST,
parsedParams.error.errors.map((e) => e.message).join(", ")
fromZodError(parsedParams.error)
)
);
}