From 79b6823f178e5e8779c1fbc8fc35c89f57e75566 Mon Sep 17 00:00:00 2001 From: skarppinen Date: Fri, 19 Aug 2016 16:05:23 +0100 Subject: [PATCH] Rest API changes for adding logos via admin site --- lib/api.ui.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/api.ui.js b/lib/api.ui.js index 44cbdbe..ad8a2da 100644 --- a/lib/api.ui.js +++ b/lib/api.ui.js @@ -82,4 +82,22 @@ var getSkin = module.exports.getSkin = function(restCtx, callback) { */ var getSkinVariables = module.exports.getSkinVariables = function(restCtx, tenantAlias, callback) { RestUtil.RestRequest(restCtx, '/api/ui/skin/variables', 'GET', {'tenant': tenantAlias}, callback); -}; \ No newline at end of file +}; + +/** + * Upload a new logo file to use as the tenant logo + * + * @param {RestContext} restCtx Standard REST Context object associated to an administrator. + * @param {Function} fileGenerator A method that returns an open stream to a file + * @param {String} tenantAlias The alias of the tenant for which the variables should be retrieved. + * @param {Function} callback Standard callback method + * @param {Object} callback.err Error object containing error code and error message + * @param {Object} callback.url The variables grouped by their respective groups. + */ +var uploadLogo = module.exports.uploadLogo = function(restCtx, file, tenantAlias, callback) { + var params = { + 'file': file, + 'tenantAlias': tenantAlias + }; + RestUtil.RestRequest(restCtx, '/api/ui/skin/logo', 'POST', params, callback); +};