diff --git a/src/lib/api/documents.ts b/src/lib/api/documents.ts index 87b3c50d6..5ec7c9969 100644 --- a/src/lib/api/documents.ts +++ b/src/lib/api/documents.ts @@ -36,7 +36,9 @@ export async function search( endpoint.searchParams.set("q", query); for (const [k, v] of Object.entries(options)) { - endpoint.searchParams.set(k, String(v)); + if (v) { + endpoint.searchParams.set(k, String(v)); + } } const resp = await fetch(endpoint, { credentials: "include" }); diff --git a/src/lib/api/types.d.ts b/src/lib/api/types.d.ts index 54c1221ab..3359c317e 100644 --- a/src/lib/api/types.d.ts +++ b/src/lib/api/types.d.ts @@ -9,6 +9,8 @@ import type { User, Org } from "@/api/types/orgAndUser"; import type { Project } from "@/api/types/project"; import type { Page } from "@/api/types/common"; +export type { Page } from "@/api/types/common"; + export type Access = "public" | "private" | "organization"; // https://www.documentcloud.org/help/api#access-levels export type Data = Record; diff --git a/src/routes/(embed)/stories/project-embed.stories.svelte b/src/routes/(embed)/stories/project-embed.stories.svelte index 0d6388ed5..d11f39485 100644 --- a/src/routes/(embed)/stories/project-embed.stories.svelte +++ b/src/routes/(embed)/stories/project-embed.stories.svelte @@ -1,6 +1,4 @@