fix(striker-ui): allow set detail url prefix in CRUD list

main
Tsu-ba-me 11 months ago
parent 5ad591cdc0
commit c8e7994ab9
  1. 4
      striker-ui/components/CrudList.tsx
  2. 1
      striker-ui/types/CrudList.d.ts

@ -39,6 +39,8 @@ const CrudList = <
renderDeleteItem,
renderEditForm,
renderListItem,
// Dependents
entryUrlPrefix = entriesUrl,
} = props;
const addDialogRef = useRef<DialogForwardedRefContent>(null);
@ -72,7 +74,7 @@ const CrudList = <
const { fetch: getEntry, loading: loadingEntry } = useActiveFetch<Detail>({
onData: (data) => setEntry(data),
url: entriesUrl,
url: entryUrlPrefix,
});
const addHeader = useMemo<React.ReactNode>(

@ -24,6 +24,7 @@ type DeletePromiseChainGetter<T> = (
) => Promise<T>[];
type CrudListOptionalProps<Overview> = {
entryUrlPrefix?: string;
getAddLoading?: (previous?: boolean) => boolean;
getDeletePromiseChain?: <T>(
base: DeletePromiseChainGetter<T>,

Loading…
Cancel
Save