Skip to content

Commit b4d951d

Browse files
🐛 - fix: fix a bug where the detail url of a zaak was not correctly formatted.
1 parent 93501c7 commit b4d951d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

frontend/src/pages/destructionlist/abstract/BaseListView.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ListTemplateProps,
77
Solid,
88
TypedField,
9+
formatMessage,
910
} from "@maykin-ui/admin-ui";
1011
import React, { useCallback, useMemo } from "react";
1112
import { useNavigation } from "react-router-dom";
@@ -25,6 +26,9 @@ import {
2526
useZaakSelection,
2627
} from "../hooks/useZaakSelection";
2728

29+
/** The template used to format urls to an external application providing zaak details. */
30+
const REACT_APP_ZAAK_URL_TEMPLATE = process.env.REACT_APP_ZAAK_URL_TEMPLATE;
31+
2832
export type BaseListViewProps = React.PropsWithChildren<{
2933
storageKey: string;
3034
title?: string;
@@ -80,6 +84,12 @@ export function BaseListView({
8084
const [, setFilterField] = useFilter();
8185
const [sort, setSort] = useSort();
8286

87+
// Object list.
88+
const objectList = paginatedZaken.results.map((zaak) => ({
89+
...zaak,
90+
href: formatMessage(REACT_APP_ZAAK_URL_TEMPLATE || "", zaak),
91+
}));
92+
8393
// Fields.
8494
const [fields, setFields, filterTransform] = useFields(
8595
destructionList,
@@ -176,7 +186,7 @@ export function BaseListView({
176186
fields,
177187
filterTransform,
178188
loading: state === "loading",
179-
objectList: paginatedZaken.results as unknown as AttributeData[],
189+
objectList: objectList,
180190
page,
181191
sort: sort,
182192
selected: selectable

0 commit comments

Comments
 (0)