Fix dashboard config not getting generated
This commit is contained in:
@@ -4,7 +4,7 @@ exports = module.exports = {
|
||||
getConfig,
|
||||
|
||||
prepareLocation,
|
||||
changeLocation
|
||||
setupLocation
|
||||
};
|
||||
|
||||
const AuditSource = require('../auditsource.js'),
|
||||
@@ -30,10 +30,10 @@ async function prepareLocation(req, res, next) {
|
||||
next(new HttpSuccess(202, { taskId }));
|
||||
}
|
||||
|
||||
async function changeLocation(req, res, next) {
|
||||
async function setupLocation(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.changeLocation(req.body.domain, AuditSource.fromRequest(req)));
|
||||
const [error] = await safe(dashboard.setupLocation(req.body.domain, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(204, {}));
|
||||
|
||||
Reference in New Issue
Block a user