Merge pull request '024' (#5) from ayushman into main

Reviewed-on: #5
This commit is contained in:
cereci5049 2024-08-04 21:25:50 +02:00
commit 38ac9490b8

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
)