fix(api): 🐛 oh my god stop breaking

This commit is contained in:
Jesse Wierzbinski 2024-05-08 12:41:27 -10:00
parent f71c8a50d3
commit 20629b1712
No known key found for this signature in database

View file

@ -45,6 +45,7 @@ export default (app: Hono) =>
zValidator("form", schemas.form, handleZodError), zValidator("form", schemas.form, handleZodError),
auth(meta.auth), auth(meta.auth),
async (context) => { async (context) => {
const form = context.req.valid("form");
const { username, email, password, agreement, locale, reason } = const { username, email, password, agreement, locale, reason } =
context.req.valid("form"); context.req.valid("form");
@ -94,8 +95,8 @@ export default (app: Hono) =>
"locale", "locale",
"reason", "reason",
]) { ]) {
// @ts-expect-error We don't care about typing here // @ts-expect-error We don't care about the type here
if (!parsedRequest[value]) { if (!form[value]) {
errors.details[value].push({ errors.details[value].push({
error: "ERR_BLANK", error: "ERR_BLANK",
description: `can't be blank`, description: `can't be blank`,