Skip to content

Commit

Permalink
#6 optional params are properly parsed when read from server, and pre…
Browse files Browse the repository at this point in the history
…sented to the user in original format
  • Loading branch information
jaimecasero committed Sep 28, 2015
1 parent d8b0075 commit 9799ed1
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,24 @@ <h3 id="sourceModalLabel">Default Application Router Source</h3>
})
}

//this helper methods converts the JSONified params into the
//original format the user entered.
function stringifyOptionalParams(optionalParameters){
var stringifiedParams = "";
var PARAM_SEPARATOR = "" ;
var PARAM_NAME_VALUE_SEPARATOR = "=";
for(var key in optionalParameters){
var attrName = key;
var attrValue = optionalParameters[key];
if (stringifiedParams !== "")
{
stringifiedParams = stringifiedParams + PARAM_SEPARATOR;
}
stringifiedParams = stringifiedParams + attrName + PARAM_NAME_VALUE_SEPARATOR + attrValue;
}
return stringifiedParams;
}

function addMethodApplicationFromDar(method, methodString) {
for (var i = 0; i < method.length; i++) {
methodDARInformation = method[i];
Expand All @@ -438,7 +456,7 @@ <h3 id="sourceModalLabel">Default Application Router Source</h3>
methodDARInformation.routeModifier,
methodDARInformation.routes,
methodDARInformation.order,
methodDARInformation.regex);
stringifyOptionalParams(methodDARInformation.optionalParameters));
}
}

Expand Down

0 comments on commit 9799ed1

Please sign in to comment.