make auditsource a class
this allows us to use AuditSource for the class and auditSource for the instances!
This commit is contained in:
@@ -6,7 +6,7 @@ exports = module.exports = {
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
auditSource = require('../auditsource.js'),
|
||||
AuditSource = require('../auditsource.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
HttpError = require('connect-lastmile').HttpError,
|
||||
HttpSuccess = require('connect-lastmile').HttpSuccess,
|
||||
@@ -27,7 +27,7 @@ async function setBlocklist(req, res, next) {
|
||||
|
||||
req.clearTimeout(); // can take a while if there is a lot of network ranges
|
||||
|
||||
const [error] = await safe(network.setBlocklist(req.body.blocklist, auditSource.fromRequest(req)));
|
||||
const [error] = await safe(network.setBlocklist(req.body.blocklist, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, {}));
|
||||
|
||||
Reference in New Issue
Block a user