diff options
author | crupest <crupest@outlook.com> | 2022-04-24 19:50:26 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-04-24 19:50:26 +0800 |
commit | 4fdf7d1cb50c3dd8ea8e96f7fb4cf8f655152dcc (patch) | |
tree | 570916621d3aea67f508eab1b5ab902f2d263bb0 /FrontEnd/src/utilities/url.ts | |
parent | fee641197dc4359c189b9ebea45800d71cb5aa8d (diff) | |
download | timeline-4fdf7d1cb50c3dd8ea8e96f7fb4cf8f655152dcc.tar.gz timeline-4fdf7d1cb50c3dd8ea8e96f7fb4cf8f655152dcc.tar.bz2 timeline-4fdf7d1cb50c3dd8ea8e96f7fb4cf8f655152dcc.zip |
...
Diffstat (limited to 'FrontEnd/src/utilities/url.ts')
-rw-r--r-- | FrontEnd/src/utilities/url.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/FrontEnd/src/utilities/url.ts b/FrontEnd/src/utilities/url.ts index 4f2a6ecd..45ad0ab7 100644 --- a/FrontEnd/src/utilities/url.ts +++ b/FrontEnd/src/utilities/url.ts @@ -13,5 +13,12 @@ export function applyQueryParameters<T>(url: string, query: T): string { console.error("Unknown query parameter type. Param: ", value); } } - return url + "?" + params.toString(); + + const p = params.toString(); + + if (p == "") { + return url; + } + + return url + "?" + p; } |