125
This commit is contained in:
parent
07a0cf691c
commit
3c51f0f5a2
@ -96,19 +96,10 @@ proc getUserCartTable*(db: DbConn): seq[User]=
|
||||
|
||||
proc getUserByID*(db: DbConn, id: int): User=
|
||||
var row = db.getRow(sql"SELECT * FROM users WHERE id=?", id)
|
||||
var user: User
|
||||
|
||||
user.id = parseInt(row[0])
|
||||
user.firstName = row[1]
|
||||
user.lastName = row[2]
|
||||
user.email = row[3]
|
||||
user.password = row[4]
|
||||
user.accessLevel = parseInt(row[7])
|
||||
return user
|
||||
|
||||
# result.id = parseInt(row[0])
|
||||
# result.firstName = row[1]
|
||||
# result.lastName = row[2]
|
||||
# result.email = row[3]
|
||||
# result.password = row[4]
|
||||
# result.accessLevel = parseInt(row[7])
|
||||
result.id = parseInt(row[0])
|
||||
result.firstName = row[1]
|
||||
result.lastName = row[2]
|
||||
result.email = row[3]
|
||||
result.password = row[4]
|
||||
result.accessLevel = parseInt(row[7])
|
||||
|
Loading…
Reference in New Issue
Block a user