rework custom configuration

This commit is contained in:
Girish Ramakrishnan
2019-05-10 15:53:34 -07:00
parent 800e25a7a7
commit a54be69c96
8 changed files with 50 additions and 58 deletions

View File

@@ -27,7 +27,7 @@ function createTicket(req, res, next) {
if (req.body.appId && typeof req.body.appId !== 'string') return next(new HttpError(400, 'appId must be string'));
appstore.createTicket(_.extend({ }, req.body, { email: req.user.email, displayName: req.user.displayName }), function (error) {
if (error) return next(new HttpError(503, `Error contacting cloudron.io: ${error.message}. Please email ${custom.supportEmail()}`));
if (error) return next(new HttpError(503, `Error contacting cloudron.io: ${error.message}. Please email ${custom.spec().support.email}`));
next(new HttpSuccess(201, {}));
});
@@ -36,7 +36,7 @@ function createTicket(req, res, next) {
function enableRemoteSupport(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
if (!custom.features().remoteSupport) return next(new HttpError(405, 'feature disabled by admin'));
if (!custom.spec().support.remoteSupport) return next(new HttpError(405, 'feature disabled by admin'));
if (typeof req.body.enable !== 'boolean') return next(new HttpError(400, 'enabled is required'));