From 18d4aa0c675597f48ff40237d9119bddb2756422 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 2 Feb 2021 00:58:32 +0100 Subject: [PATCH] :bug: fix register date of birth --- locales/en/auth.json | 2 +- src/routes/api/v8/auth/register.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/locales/en/auth.json b/locales/en/auth.json index ea5633df..88c2c003 100644 --- a/locales/en/auth.json +++ b/locales/en/auth.json @@ -8,7 +8,7 @@ "INVITE_ONLY": "You must be invited to register", "EMAIL_INVALID": "Invalid Email", "EMAIL_ALREADY_REGISTERED": "Email is already registered", - "DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} or older", + "DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older", "CONSENT_REQUIRED": "You must agree to Terms of Service and Privacy Policy.", "USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another" } diff --git a/src/routes/api/v8/auth/register.ts b/src/routes/api/v8/auth/register.ts index e02d8152..410c7f50 100644 --- a/src/routes/api/v8/auth/register.ts +++ b/src/routes/api/v8/auth/register.ts @@ -20,7 +20,7 @@ router.post( $email: Email, $fingerprint: String, $invite: String, - $date_of_birth: String, // "2000-04-03" + $date_of_birth: Date, // "2000-04-03" $gift_code_sku_id: String, $captcha_key: String, }), @@ -110,7 +110,7 @@ router.post( throw FieldErrors({ date_of_birth: { code: "DATE_OF_BIRTH_UNDERAGE", - message: req.t("auth:register.DATE_OF_BIRTH_UNDERAGE"), + message: req.t("auth:register.DATE_OF_BIRTH_UNDERAGE", { years: register.dateOfBirth.minimum }), }, }); }