@edenjs/audit
Advanced tools
Comparing version 1.0.3 to 1.0.6
@@ -129,3 +129,2 @@ /** | ||
let audit = null; | ||
let create = true; | ||
@@ -136,3 +135,2 @@ // Check for website model | ||
audit = await Audit.findById(req.params.id); | ||
create = false; | ||
} | ||
@@ -159,3 +157,3 @@ | ||
// Render page | ||
res.render('audit/admin/update', { | ||
return res.render('audit/admin/update', { | ||
item : await audit.sanitise(), | ||
@@ -191,3 +189,2 @@ form : sanitised, | ||
let audit = new Audit(); | ||
let create = true; | ||
@@ -198,3 +195,2 @@ // Check for website model | ||
audit = await Audit.findById(req.params.id); | ||
create = false; | ||
} | ||
@@ -257,3 +253,3 @@ | ||
// Render page | ||
res.render('audit/admin/remove', { | ||
return res.render('audit/admin/remove', { | ||
item : await audit.sanitise(), | ||
@@ -352,3 +348,3 @@ title : `Remove ${audit.get('_id').toString()}`, | ||
title : 'Updates', | ||
format : async (col, row) => { | ||
format : async (col) => { | ||
// return name | ||
@@ -355,0 +351,0 @@ return col && Object.keys(col || {}).length ? Object.keys(col || {}).join(', ') : '<i>N/A</i>'; |
@@ -12,3 +12,3 @@ | ||
* create audit daemon class | ||
* | ||
* | ||
* @extends Daemon | ||
@@ -20,5 +20,5 @@ */ | ||
*/ | ||
constructor() { | ||
constructor(...args) { | ||
// run super | ||
super(...arguments); | ||
super(...args); | ||
@@ -48,2 +48,3 @@ // get audit models | ||
updates : {}, | ||
// eslint-disable-next-line no-nested-ternary | ||
message : `${(way === 'create' ? 'Created' : (way === 'update' ? 'Updated' : 'Removed'))} ${subject.constructor.name}`, | ||
@@ -82,2 +83,2 @@ }); | ||
*/ | ||
exports = module.exports = AuditDaemon; | ||
module.exports = AuditDaemon; |
// require local dependencies | ||
const Model = require('model'); | ||
const config = require('config'); | ||
const Model = require('model'); | ||
@@ -13,5 +12,5 @@ /** | ||
*/ | ||
constructor() { | ||
constructor(...args) { | ||
// run super | ||
super(...arguments); | ||
super(...args); | ||
@@ -30,3 +29,3 @@ // bind methods | ||
const sanitised = { | ||
id : this.get('_id') ? this.get('_id').toString() : null | ||
id : this.get('_id') ? this.get('_id').toString() : null, | ||
}; | ||
@@ -33,0 +32,0 @@ |
{ | ||
"name": "@edenjs/audit", | ||
"description": "nothing yet", | ||
"version": "1.0.3", | ||
"dependencies": {}, | ||
"version": "1.0.6", | ||
"dependencies": { | ||
"escape-string-regexp": "^2.0.0" | ||
}, | ||
"engines": { | ||
@@ -7,0 +9,0 @@ "node": ">= 8.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19950
12
1
514
+ Addedescape-string-regexp@^2.0.0
+ Addedescape-string-regexp@2.0.0(transitive)