crash fixes
This commit is contained in:
@@ -4,7 +4,7 @@ exports = module.exports = {
|
||||
getConfig,
|
||||
|
||||
startPrepareLocation,
|
||||
setupLocation
|
||||
changeLocation
|
||||
};
|
||||
|
||||
const AuditSource = require('../auditsource.js'),
|
||||
@@ -31,10 +31,10 @@ async function startPrepareLocation(req, res, next) {
|
||||
next(new HttpSuccess(202, { taskId }));
|
||||
}
|
||||
|
||||
async function setupLocation(req, res, next) {
|
||||
async function changeLocation(req, res, next) {
|
||||
if (!req.body.domain || typeof req.body.domain !== 'string') return next(new HttpError(400, 'domain must be a string'));
|
||||
|
||||
const [error] = await safe(dashboard.setupLocation(constants.DASHBOARD_SUBDOMAIN, req.body.domain, AuditSource.fromRequest(req)));
|
||||
const [error] = await safe(dashboard.changeLocation(constants.DASHBOARD_SUBDOMAIN, req.body.domain, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(204, {}));
|
||||
|
||||
Reference in New Issue
Block a user