summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-02 00:58:32 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-02 00:58:32 +0100
commit18d4aa0c675597f48ff40237d9119bddb2756422 (patch)
treee01a3c06aee3e7e542a28b5f454cbad03d9962e4
parent:art: Body Parser error (diff)
downloadserver-ts-18d4aa0c675597f48ff40237d9119bddb2756422.tar.xz
:bug: fix register date of birth
-rw-r--r--locales/en/auth.json2
-rw-r--r--src/routes/api/v8/auth/register.ts4
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 }), }, }); }