make auditsource a class
this allows us to use AuditSource for the class and auditSource for the instances!
This commit is contained in:
@@ -9,7 +9,7 @@ exports = module.exports = {
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
auditSource = require('../auditsource.js'),
|
||||
AuditSource = require('../auditsource.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
debug = require('debug')('box:routes/mailserver'),
|
||||
HttpError = require('connect-lastmile').HttpError,
|
||||
@@ -68,7 +68,7 @@ async function setLocation(req, res, next) {
|
||||
if (typeof req.body.domain !== 'string') return next(new HttpError(400, 'domain must be a string'));
|
||||
if (typeof req.body.subdomain !== 'string') return next(new HttpError(400, 'subdomain must be a string'));
|
||||
|
||||
const [error, taskId] = await safe(mail.setLocation(req.body.subdomain, req.body.domain, auditSource.fromRequest(req)));
|
||||
const [error, taskId] = await safe(mail.setLocation(req.body.subdomain, req.body.domain, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, { taskId }));
|
||||
|
||||
Reference in New Issue
Block a user