Make spaces an edition instead of setting

This commit is contained in:
Girish Ramakrishnan
2018-08-28 18:31:48 -07:00
parent 4f7242fa6a
commit e0cd7999eb
8 changed files with 20 additions and 94 deletions

View File

@@ -23,10 +23,7 @@ exports = module.exports = {
setAppstoreConfig: setAppstoreConfig,
getPlatformConfig: getPlatformConfig,
setPlatformConfig: setPlatformConfig,
setSpacesConfig: setSpacesConfig,
getSpacesConfig: getSpacesConfig
setPlatformConfig: setPlatformConfig
};
var assert = require('assert'),
@@ -207,26 +204,6 @@ function setPlatformConfig(req, res, next) {
});
}
function getSpacesConfig(req, res, next) {
settings.getSpacesConfig(function (error, config) {
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(200, config));
});
}
function setSpacesConfig(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
settings.setSpacesConfig(req.body, function (error) {
if (error && error.reason === SettingsError.BAD_FIELD) return next(new HttpError(400, error.message));
if (error && error.reason === SettingsError.EXTERNAL_ERROR) return next(new HttpError(402, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(200, {}));
});
}
function getAppstoreConfig(req, res, next) {
settings.getAppstoreConfig(function (error, result) {
if (error) return next(new HttpError(500, error));