add route to get the timezone

This commit is contained in:
Girish Ramakrishnan
2016-05-03 12:10:16 -07:00
parent f57f8f5e58
commit 7262eb208f
3 changed files with 22 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ exports = module.exports = {
getBackupConfig: getBackupConfig,
setBackupConfig: setBackupConfig,
getTimeZone: getTimeZone,
setCertificate: setCertificate,
setAdminCertificate: setAdminCertificate
};
@@ -69,6 +71,13 @@ function getCloudronName(req, res, next) {
});
}
function getTimeZone(req, res, next) {
settings.getTimeZone(function (error, tz) {
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(200, { timeZone: tz }));
});
}
function setCloudronAvatar(req, res, next) {
assert.strictEqual(typeof req.files, 'object');