commit
38ac9490b8
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue