diff --git a/lib/group.js b/lib/group.js index f7bf278..3431546 100644 --- a/lib/group.js +++ b/lib/group.js @@ -11,10 +11,7 @@ class Group { if (error) console.error(error) const g = await this.get({ nt_group_id: args.nt_group_id }) - if (g.length) { - // console.log(g) - return g[0].nt_group_id - } + if (g.length) return g[0].id const groupId = await Mysql.insert(`INSERT INTO nt_group`, args) return groupId diff --git a/lib/session.test.js b/lib/session.test.js index e94c779..c27062d 100644 --- a/lib/session.test.js +++ b/lib/session.test.js @@ -25,7 +25,6 @@ describe('session', function () { describe('get', () => { it('finds a session by ID', async () => { const s = await session.get({ nt_user_session_id: sessionId }) - // console.log(s) assert.ok(s.nt_user_session_id) }) diff --git a/lib/user.js b/lib/user.js index 9637a1c..df73150 100644 --- a/lib/user.js +++ b/lib/user.js @@ -1,9 +1,10 @@ const crypto = require('node:crypto') const validate = require('@nictool/validate') -const Config = require('./config') const Mysql = require('./mysql') const Util = require('./util') +Util.setEnv() +const Config = require('./config') class User { constructor(args) {