diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-05-30 23:28:23 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-05-30 23:29:35 +1000 |
commit | f420cfd36c8ed263487c9aac2209a3052eecc3a7 (patch) | |
tree | 51764666afc32e8d6c3e9637552bbb858935bcb9 /api/src | |
parent | Merge pull request #758 from xFlum3/patch-2 (diff) | |
download | server-f420cfd36c8ed263487c9aac2209a3052eecc3a7.tar.xz |
Respect register_dateOfBirth_required = false
Diffstat (limited to 'api/src')
-rw-r--r-- | api/src/routes/auth/register.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/routes/auth/register.ts b/api/src/routes/auth/register.ts index cd1bcb72..94dd6502 100644 --- a/api/src/routes/auth/register.ts +++ b/api/src/routes/auth/register.ts @@ -128,7 +128,7 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re throw FieldErrors({ date_of_birth: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") } }); - } else if (register.dateOfBirth.minimum) { + } else if (register.dateOfBirth.required && register.dateOfBirth.minimum) { const minimum = new Date(); minimum.setFullYear(minimum.getFullYear() - register.dateOfBirth.minimum); body.date_of_birth = new Date(body.date_of_birth as Date); |