From 54ab26e2ed61864ff8a26c60f5c80a2d3c6640fa Mon Sep 17 00:00:00 2001 From: engern Date: Sat, 21 Nov 2015 14:00:58 +0100 Subject: [PATCH] Simplifying thge code even further Realized that we don't need to convert the exisitng dictionary to a new dictionary. --- .../src/common/resources/macro.resource.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js index af0d5292c6..e4201c6d3e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js @@ -45,28 +45,14 @@ function macroResource($q, $http, umbRequestHelper) { */ getMacroResultAsHtmlForEditor: function (macroAlias, pageId, macroParamDictionary) { - //need to format the query string for the custom dictionary var query = "macroAlias=" + macroAlias + "&pageId=" + pageId; - var macroParams = {}; - if (macroParamDictionary) { - _.each(macroParamDictionary, function (val, key) { - //check for null - val = val ? val : ""; - //need to detect if the val is a string or an object - if (!angular.isString(val)) { - //if it's not a string we'll send it through the json serializer - val = angular.toJson(val); - } - macroParams[key] = val; - }); - } return umbRequestHelper.resourcePromise( $http.post( umbRequestHelper.getApiUrl( "macroApiBaseUrl", "GetMacroResultAsHtmlForEditor", - query), JSON.stringify(macroParams)), + query), JSON.stringify(macroParamDictionary)), 'Failed to retrieve macro result for macro with alias ' + macroAlias); } };