fix destinations.js

This commit is contained in:
dklimpel 2024-02-06 10:48:17 +01:00
parent 2b98ef0270
commit 61b29534e5

View File

@ -53,7 +53,7 @@ export const DestinationReconnectButton = props => {
const record = useRecordContext(); const record = useRecordContext();
const refresh = useRefresh(); const refresh = useRefresh();
const notify = useNotify(); const notify = useNotify();
const [handleReconnect, { isLoading }] = useDelete("destinations"); const [handleReconnect, { isLoading }] = useDelete();
// Reconnect is not required if no error has occurred. (`failure_ts`) // Reconnect is not required if no error has occurred. (`failure_ts`)
if (!record || !record.failure_ts) return null; if (!record || !record.failure_ts) return null;
@ -63,7 +63,8 @@ export const DestinationReconnectButton = props => {
e.stopPropagation(); e.stopPropagation();
handleReconnect( handleReconnect(
{ payload: { id: record.id } }, "destinations",
{ id: record.id },
{ {
onSuccess: () => { onSuccess: () => {
notify("ra.notification.updated", { notify("ra.notification.updated", {
@ -95,7 +96,7 @@ const DestinationShowActions = props => (
</TopToolbar> </TopToolbar>
); );
const DestinationTitle = props => { const DestinationTitle = () => {
const record = useRecordContext(); const record = useRecordContext();
const translate = useTranslate(); const translate = useTranslate();
return ( return (
@ -105,7 +106,7 @@ const DestinationTitle = props => {
); );
}; };
export const DestinationList = props => { export const DestinationList = () => {
return ( return (
<List <List
filters={<DestinationFilter />} filters={<DestinationFilter />}
@ -128,7 +129,7 @@ export const DestinationList = props => {
); );
}; };
export const DestinationShow = props => { export const DestinationShow = () => {
const translate = useTranslate(); const translate = useTranslate();
return ( return (
<Show actions={<DestinationShowActions />} title={<DestinationTitle />}> <Show actions={<DestinationShowActions />} title={<DestinationTitle />}>