feat: add current user to req
This commit is contained in:
parent
48ac1249c8
commit
5299bd34ee
3 changed files with 447 additions and 0 deletions
5
db.js
5
db.js
|
|
@ -55,6 +55,10 @@ function getUser(username) {
|
|||
return db.prepare("SELECT * from users where username = ?").get(username);
|
||||
}
|
||||
|
||||
function getUserById(id) {
|
||||
return db.prepare("SELECT id, username FROM users WHERE id = ?").get(id);
|
||||
}
|
||||
|
||||
// _ _ _______ ______ ___ _ _______ __ __ _______ _______
|
||||
// | | _ | || || _ | | | | || || | | || || |
|
||||
// | || || || _ || | || | |_| || _____|| |_| || _ || _ |
|
||||
|
|
@ -714,6 +718,7 @@ module.exports = {
|
|||
getDbInstance,
|
||||
getAllRoutes,
|
||||
getUser,
|
||||
getUserById,
|
||||
createUser,
|
||||
getStructures,
|
||||
getStructure,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue