diff --git a/web/src/api/Client.ts b/web/src/api/Client.ts index 583e2946c..3556b0c88 100644 --- a/web/src/api/Client.ts +++ b/web/src/api/Client.ts @@ -13,7 +13,9 @@ export class Client { if (query) { const queryString = Object.keys(query) .filter((k) => query[k] !== null) - .map((k) => encodeURIComponent(k) + "=" + encodeURIComponent(query[k])) + // we default to a string in query[k] as we've filtered out the null above + // this is just for type-hinting + .map((k) => encodeURIComponent(k) + "=" + encodeURIComponent(query[k] || "")) .join("&"); builtUrl += `?${queryString}`; } diff --git a/web/src/elements/router/Route.ts b/web/src/elements/router/Route.ts index 3a52b3559..cafbb7740 100644 --- a/web/src/elements/router/Route.ts +++ b/web/src/elements/router/Route.ts @@ -2,6 +2,7 @@ import { html, TemplateResult } from "lit-html"; export const SLUG_REGEX = "[-a-zA-Z0-9_]+"; export const ID_REGEX = "\\d+"; +export const UUID_REGEX = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"; export class Route { url: RegExp;