add min age notice (#9)
All checks were successful
delpoy / build-and-deploy (push) Successful in 40s
All checks were successful
delpoy / build-and-deploy (push) Successful in 40s
This commit is contained in:
parent
09da379812
commit
4e16487d3d
@ -39,6 +39,11 @@
|
|||||||
async function sendRegister() {
|
async function sendRegister() {
|
||||||
// eslint-disable-next-line no-async-promise-executor
|
// eslint-disable-next-line no-async-promise-executor
|
||||||
registerRequest = new Promise(async (resolve, reject) => {
|
registerRequest = new Promise(async (resolve, reject) => {
|
||||||
|
if (birthdayInput.valueAsDate || new Date() > new Date(Date.now() - 1000 * 60 * 60 * 24 * 365 * 6)) {
|
||||||
|
reject(Error('Bitte gib deinen vollständigen Geburtstag und die korrekte Jahreszahl an. Du musst mindestens 6 Jahre alt sein.'))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const response = await fetch(`${env.PUBLIC_BASE_PATH}/register`, {
|
const response = await fetch(`${env.PUBLIC_BASE_PATH}/register`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: new FormData(document.forms[0])
|
body: new FormData(document.forms[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user