This commit is contained in:
cereci5049 2024-05-06 01:15:43 +05:30
parent 07a0cf691c
commit 3c51f0f5a2

View File

@ -96,19 +96,10 @@ proc getUserCartTable*(db: DbConn): seq[User]=
proc getUserByID*(db: DbConn, id: int): User= proc getUserByID*(db: DbConn, id: int): User=
var row = db.getRow(sql"SELECT * FROM users WHERE id=?", id) 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.id = parseInt(row[0])
# result.firstName = row[1] result.firstName = row[1]
# result.lastName = row[2] result.lastName = row[2]
# result.email = row[3] result.email = row[3]
# result.password = row[4] result.password = row[4]
# result.accessLevel = parseInt(row[7]) result.accessLevel = parseInt(row[7])