Chore: refactor to use new schema changing queries
This commit is contained in:
parent
304f792484
commit
e6059be8d2
44 changed files with 185 additions and 171 deletions
13
lib/token-manager.js
Normal file
13
lib/token-manager.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const db = require('./db')
|
||||
|
||||
function getTokenList () {
|
||||
const sql = `select * from user_tokens`
|
||||
return db.$any(sql)
|
||||
}
|
||||
|
||||
function revokeToken (token) {
|
||||
const sql = `delete from user_tokens where token = $1`
|
||||
return db.$none(sql, [token])
|
||||
}
|
||||
|
||||
module.exports = { getTokenList, revokeToken }
|
||||
Loading…
Add table
Add a link
Reference in a new issue