diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag index 88babb54f0f..f118862bf16 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag @@ -25,24 +25,21 @@ var uriMatcher = new URIMatcher(String(uri)); var devicemgtProps = require("/app/conf/devicemgt-props.js").config(); var serviceInvokers = require("/app/modules/backend-service-invoker.js")["backendServiceInvoker"]; -if (uriMatcher.match("/{context}/api/data-tables/invoker")) { - var url = request.getParameter("url"); - var targetURL; - var payload = request.getContent(); - - function appendQueryParam (url, queryParam , value) { - if (url.indexOf("?") > 0) { - return url + "&" + queryParam + "=" + value; - } - return url + "?" + queryParam + "=" + value; +function appendQueryParam (url, queryParam , value) { + if (url.indexOf("?") > 0) { + return url + "&" + queryParam + "=" + value; } - targetURL = devicemgtProps["httpsURL"] + request.getParameter("url"); + return url + "?" + queryParam + "=" + value; +} +if (uriMatcher.match("/{context}/api/data-tables/invoker")) { + var url = request.getParameter("url"); + var targetURL = devicemgtProps["httpsURL"] + request.getParameter("url"); var allParams = request.getAllParameters(); for (var key in allParams) { if (allParams.hasOwnProperty(key)) { - if(key == "limit" || key == "offset" || key == "filter"){ + if (key == "limit" || key == "offset" || key == "filter") { targetURL = appendQueryParam(targetURL, key, allParams[key]); } }