diff --git a/apps/web/lib/api/documents/get-member-documents.ts b/apps/web/lib/api/documents/get-member-documents.ts index 9df4302b3..4bd7519e5 100644 --- a/apps/web/lib/api/documents/get-member-documents.ts +++ b/apps/web/lib/api/documents/get-member-documents.ts @@ -7,8 +7,17 @@ interface Query { } export default async function getMemberDocuments({ id, page }: Query) { + const query = new URLSearchParams({ + iid: id, + p: page.toString(), + avd: "dokument", + sort: "datum", + sortorder: "datum", + utformat: "json", + }); + const response = await fetch( - `${PARLIAMENT_BASE_URL}/dokumentlista/?avd=dokument&sort=datum&sortorder=datum&utformat=json&iid=${id}&p=${page}`, + `${PARLIAMENT_BASE_URL}/dokumentlista/?${query}`, { next: { revalidate: 60 * 60 * 24 } }, ); const data = await response.json();