Skip to content

Commit

Permalink
Add DateTime formatting in requestUrl for QueryParameters in Typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjarne Callewaert committed Feb 14, 2022
1 parent f71d05c commit 07fcc27
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ else if ({{ parameter.VariableName }} !== undefined)
{% endif -%}
{% endif -%}
{% if parameter.IsDateOrDateTimeArray -%}
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { url_ += "{{ parameter.Name }}=" + encodeURIComponent(item_ ? "" + item_.toJSON() : "null") + "&"; });
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { url_ += "{{ parameter.Name }}=" + encodeURIComponent(item_ ? "" + item_.{{ parameter.GetDateTimeToString }} : "null") + "&"; });
{% elsif parameter.IsObjectArray -%}
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach((item, index) => {
for (let attr in item)
Expand All @@ -50,7 +50,7 @@ else if ({{ parameter.VariableName }} !== undefined)
}
});
{% elsif parameter.IsDateOrDateTime -%}
url_ += "{{ parameter.Name }}=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.toJSON() : "{{ QueryNullValue }}") + "&";
url_ += "{{ parameter.Name }}=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.{{ parameter.GetDateTimeToString }} : "{{ QueryNullValue }}") + "&";
{% elsif parameter.IsArray -%}
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item => { url_ += "{{ parameter.Name }}=" + encodeURIComponent("" + item) + "&"; });
{% else -%}
Expand Down

0 comments on commit 07fcc27

Please sign in to comment.