From 20629b171292c3d993d042b7363cfeb01f914f78 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Wed, 8 May 2024 12:41:27 -1000 Subject: [PATCH] fix(api): :bug: oh my god stop breaking --- server/api/api/v1/accounts/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/api/api/v1/accounts/index.ts b/server/api/api/v1/accounts/index.ts index 6e603afa..f7bf1b75 100644 --- a/server/api/api/v1/accounts/index.ts +++ b/server/api/api/v1/accounts/index.ts @@ -45,6 +45,7 @@ export default (app: Hono) => zValidator("form", schemas.form, handleZodError), auth(meta.auth), async (context) => { + const form = context.req.valid("form"); const { username, email, password, agreement, locale, reason } = context.req.valid("form"); @@ -94,8 +95,8 @@ export default (app: Hono) => "locale", "reason", ]) { - // @ts-expect-error We don't care about typing here - if (!parsedRequest[value]) { + // @ts-expect-error We don't care about the type here + if (!form[value]) { errors.details[value].push({ error: "ERR_BLANK", description: `can't be blank`,