This commit is contained in:
cereci5049 2024-08-05 00:55:14 +05:30
parent 368a9317b0
commit 526cb4934b

View file

@ -14,19 +14,21 @@ proc signup*(ctx: Context): string=
firstName = ctx.urlForm["fn"]
lastName = ctx.urlForm["ln"]
email = ctx.urlForm["em"]
phone = ctx.urlForm["ph"]
password = ctx.urlForm["pw"]
conn = newTurso()
echo firstName, lastName, email, password
if firstName.len == 0 or lastName.len == 0 or email.len == 0 or password.len == 0:
if firstName.len == 0 or lastName.len == 0 or email.len == 0 or phone.len == 0 or password.len == 0:
ctx.send(parseJson("""{"ok": false, "failure": "Missing parameters"}"""))
else:
var user = User(
firstName: firstName,
lastName: lastName,
email: email,
phone: phone,
password: password,
accessLevel: 1
)