store subdomain in database instead of fqdn
this makes it more consistent with the locations table
This commit is contained in:
@@ -9,6 +9,7 @@ exports = module.exports = {
|
||||
|
||||
const AuditSource = require('../auditsource.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
constants = require('../constants.js'),
|
||||
dashboard = require('../dashboard.js'),
|
||||
HttpError = require('connect-lastmile').HttpError,
|
||||
HttpSuccess = require('connect-lastmile').HttpSuccess,
|
||||
@@ -33,7 +34,7 @@ async function startPrepareLocation(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.setupLocation(req.body.domain, AuditSource.fromRequest(req)));
|
||||
const [error] = await safe(dashboard.setupLocation(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