mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(api): 🐛 oh my god stop breaking
This commit is contained in:
parent
f71c8a50d3
commit
20629b1712
|
|
@ -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`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue