diff options
Diffstat (limited to '')
-rw-r--r-- | nodejs/database/config.js | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/nodejs/database/config.js b/nodejs/database/config.js deleted file mode 100644 index 7a50f68..0000000 --- a/nodejs/database/config.js +++ /dev/null @@ -1,23 +0,0 @@ -import db from './db.js'; - -const getTokenStatement = db.prepare(`SELECT value->>'token' as token from config where key = 'register_data';`); -const registerAgentStatement = db.prepare(`INSERT INTO config(key, value) VALUES ('register_data', json(?));`); - -export function getToken() { - try { - return getTokenStatement.get().token; - } catch (err) { - console.log(err); - return null; - } -} - -export function registerAgent(data) { - try { - registerAgentStatement.run(JSON.stringify(data)); - return true; - } catch (err) { - console.log(err); - return false; - } -} |