DTP Base provides a scalable and secure Node.js application development harness ready for production service.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
697 B

// action-audit.js
// Copyright (C) 2024 DTP Technologies, LLC
// All Rights Reserved
'use strict';
import mongoose from 'mongoose';
const ActionAudit = mongoose.model('ActionAudit');
import { SiteService } from '../../lib/site-lib.js';
export default class ActionAuditService extends SiteService {
static get slug () { return 'actionAudit'; }
static get name ( ) { return 'ActionAuditService'; }
constructor (dtp) {
super(dtp, ActionAuditService);
}
async auditRequest (req, note) {
const NOW = new Date();
const audit = new ActionAudit();
audit.created = NOW;
audit.user = req.user;
audit.ip = req.ip;
audit.note = note;
await audit.save();
}
}