Linting
This commit is contained in:
2
app.js
2
app.js
@@ -22,7 +22,7 @@ app.use('/users', users);
|
|||||||
|
|
||||||
// catch 404 and forward to error handler
|
// catch 404 and forward to error handler
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
console.log('[App::use] 404: Not Found', { args: arguments })
|
console.log('[App::use] 404: Not Found', { args: arguments });
|
||||||
var err = new Error('Not Found', { args: arguments });
|
var err = new Error('Not Found', { args: arguments });
|
||||||
err.status = 404;
|
err.status = 404;
|
||||||
next(err);
|
next(err);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ module.exports = {
|
|||||||
|
|
||||||
all: (e) => {
|
all: (e) => {
|
||||||
const promise = new Promise((resolve, reject) => {
|
const promise = new Promise((resolve, reject) => {
|
||||||
var model = VendorModel
|
ProfileModel
|
||||||
.find({})
|
.find({})
|
||||||
.sort({ order: 1 })
|
.sort({ order: 1 })
|
||||||
.populate({
|
.populate({
|
||||||
@@ -138,7 +138,7 @@ module.exports = {
|
|||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result) {
|
if (results) {
|
||||||
resolve(results);
|
resolve(results);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ module.exports = {
|
|||||||
if (e) {
|
if (e) {
|
||||||
e.emit('forceReset', err, null);
|
e.emit('forceReset', err, null);
|
||||||
} else if (callback) {
|
} else if (callback) {
|
||||||
callback(result);
|
callback(err);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -191,7 +191,7 @@ module.exports = {
|
|||||||
if (e) {
|
if (e) {
|
||||||
e.emit('markUsed', err, null);
|
e.emit('markUsed', err, null);
|
||||||
} else {
|
} else {
|
||||||
console.error('[ResetModel::markUsed] Error marking password reset token used', { token: result });
|
console.error('[ResetModel::markUsed] Error marking password reset token used', { token: err });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const RoleModel = Mongoose.model('roles', RoleSchema);
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
canRole: (e, roleId, action, callback) => {
|
canRole: (e, roleId, action, callback) => {
|
||||||
[initial, canElevate = false] = Array.isArray(action) ? action : [action];
|
var [initial, canElevate = false] = Array.isArray(action) ? action : [action];
|
||||||
|
|
||||||
RoleModel.findById(roleId, (err, result) => {
|
RoleModel.findById(roleId, (err, result) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user