aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/utilities
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-13 21:23:30 +0800
committercrupest <crupest@outlook.com>2021-02-13 21:23:30 +0800
commitfe5128137f530daf8ca315cb89811121c6c2c9da (patch)
tree34cbdb7895e18d34779b2209a1e9aae0fde20cf2 /FrontEnd/src/app/utilities
parentaeed3cb80d8c0a62d0ccc565733c4a213759c5bd (diff)
downloadtimeline-fe5128137f530daf8ca315cb89811121c6c2c9da.tar.gz
timeline-fe5128137f530daf8ca315cb89811121c6c2c9da.tar.bz2
timeline-fe5128137f530daf8ca315cb89811121c6c2c9da.zip
...
Diffstat (limited to 'FrontEnd/src/app/utilities')
-rw-r--r--FrontEnd/src/app/utilities/url.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/FrontEnd/src/app/utilities/url.ts b/FrontEnd/src/app/utilities/url.ts
index 21ad6304..4f2a6ecd 100644
--- a/FrontEnd/src/app/utilities/url.ts
+++ b/FrontEnd/src/app/utilities/url.ts
@@ -4,7 +4,8 @@ export function applyQueryParameters<T>(url: string, query: T): string {
const params = new URLSearchParams();
for (const [key, value] of Object.entries(query)) {
- if (typeof value === "string") params.set(key, value);
+ if (value == null) void 0;
+ else if (typeof value === "string") params.set(key, value);
else if (typeof value === "number") params.set(key, String(value));
else if (typeof value === "boolean") params.set(key, String(value));
else if (value instanceof Date) params.set(key, value.toISOString());