Add supportConfig in database

This commit is contained in:
Girish Ramakrishnan
2020-02-05 14:30:56 -08:00
parent 2f6933102c
commit 5145ea3530
6 changed files with 80 additions and 17 deletions

View File

@@ -117,6 +117,14 @@ function setFooter(req, res, next) {
});
}
function getSupportConfig(req, res, next) {
settings.getSupportConfig(function (error, supportConfig) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, supportConfig));
});
}
function setCloudronAvatar(req, res, next) {
assert.strictEqual(typeof req.files, 'object');
@@ -330,6 +338,8 @@ function get(req, res, next) {
case settings.CLOUDRON_AVATAR_KEY: return getCloudronAvatar(req, res, next);
case settings.SUPPORT_CONFIG_KEY: return getSupportConfig(req, res, next);
default: return next(new HttpError(404, 'No such setting'));
}
}