system: return activation time if we have it
This commit is contained in:
@@ -4,6 +4,7 @@ exports = module.exports = {
|
||||
add,
|
||||
upsertLoginEvent,
|
||||
get,
|
||||
getActivationEvent,
|
||||
listPaged,
|
||||
cleanup,
|
||||
_clear: clear,
|
||||
@@ -145,7 +146,14 @@ async function upsertLoginEvent(action, source, data) {
|
||||
async function get(id) {
|
||||
assert.strictEqual(typeof id, 'string');
|
||||
|
||||
const result = await database.query('SELECT ' + EVENTLOG_FIELDS + ' FROM eventlog WHERE id = ?', [ id ]);
|
||||
const result = await database.query(`SELECT ${EVENTLOG_FIELDS} FROM eventlog WHERE id = ?`, [ id ]);
|
||||
if (result.length === 0) return null;
|
||||
|
||||
return postProcess(result[0]);
|
||||
}
|
||||
|
||||
async function getActivationEvent() {
|
||||
const result = await database.query(`SELECT ${EVENTLOG_FIELDS} FROM eventlog WHERE action = ? ORDER BY creationTime`, [ exports.ACTION_ACTIVATE ]);
|
||||
if (result.length === 0) return null;
|
||||
|
||||
return postProcess(result[0]);
|
||||
|
||||
Reference in New Issue
Block a user