userdirectory: add eventlog entry

This commit is contained in:
Girish Ramakrishnan
2024-06-12 10:46:23 +02:00
parent b4e7e394c3
commit b570f2f77d
6 changed files with 19 additions and 6 deletions

View File

@@ -80,6 +80,8 @@ exports = module.exports = {
ACTION_USER_UPDATE: 'user.update',
ACTION_USER_TRANSFER: 'user.transfer',
ACTION_USER_DIRECTORY_PROFILE_CONFIG_UPDATE: 'userdirectory.profileconfig.update',
ACTION_VOLUME_ADD: 'volume.add',
ACTION_VOLUME_UPDATE: 'volume.update',
ACTION_VOLUME_REMOUNT: 'volume.remount',
@@ -169,7 +171,7 @@ async function listPaged(actions, search, page, perPage) {
assert.strictEqual(typeof page, 'number');
assert.strictEqual(typeof perPage, 'number');
let data = [];
const data = [];
let query = `SELECT ${EVENTLOG_FIELDS} FROM eventlog`;
if (actions.length || search) query += ' WHERE';
@@ -206,7 +208,7 @@ async function cleanup(options) {
];
let query = `SELECT ${EVENTLOG_FIELDS} FROM eventlog WHERE creationTime <= ? AND (`;
let data = [ creationTime ];
const data = [ creationTime ];
actions.forEach(function (action, i) {
query += ' action = ? ';
data.push(action);