mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
perform test
test to courses Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -12,11 +12,12 @@ const mdl_UserActivity = require('../models/users/user_activity.mdl');
|
||||
* @param {Object} [opts.details] — free-form JSONB context
|
||||
*/
|
||||
function logActivity(userId, action, { entityType = null, entityId = null, sessionId = null, details = null } = {}) {
|
||||
const numericId = entityId !== null ? Number(entityId) : null;
|
||||
mdl_UserActivity.create({
|
||||
user_id: userId,
|
||||
action,
|
||||
entity_type: entityType,
|
||||
entity_id: entityId,
|
||||
entity_id: Number.isFinite(numericId) ? numericId : null,
|
||||
session_id: sessionId,
|
||||
details,
|
||||
}).catch((err) => console.error('[USER_ACTIVITY] Failed to log:', action, err.message));
|
||||
|
||||
Reference in New Issue
Block a user