belgac-optionated-express-mongo-toolbelt
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -6,2 +6,3 @@ const extendsIfExists = require('./extendsIfExists'); | ||
const getCreatedby = (data, id) => data && data.createdBy ? data.createdBy : id; | ||
const getCreatorGroup = (data, id) => data && data.creatorGroup ? data.creatorGroup: id; | ||
@@ -13,6 +14,8 @@ module.exports = (name) => (app) => (req, res, next) => { | ||
createdBy: getCreatedby(req[name], req.auth._id || ''), | ||
creatorGroup: getCreatorGroup(req[nam], req.auth.userGroupId || ''), | ||
updatedAt: Date.now(), | ||
updatedBy: req.auth._id || '', | ||
updatorGroup: req.auth.userGroupId, | ||
}); | ||
next(); | ||
} |
@@ -6,3 +6,3 @@ const getCollection = require('./collection'); | ||
module.exports = (name) => (app) => { | ||
const saveCollection = collectionSave(getCollection(name)(app)); | ||
getCollection | ||
return (req, res, next) => { | ||
@@ -9,0 +9,0 @@ req[name] |
{ | ||
"name": "belgac-optionated-express-mongo-toolbelt", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
12285
338