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`,