Update usage of useNotify hook (#234)

Co-authored-by: Michael Albert <37796947+awesome-michael@users.noreply.github.com>
This commit is contained in:
Dirk Klimpel 2023-01-24 15:28:01 +01:00 committed by GitHub
parent 2e59190bd0
commit 6d30af9976
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 10 deletions

View file

@ -169,7 +169,7 @@ const LoginPage = ({ theme }) => {
: typeof error === "undefined" || !error.message
? "ra.auth.sign_in_error"
: error.message,
"warning"
{ type: "warning" }
);
});
};

View file

@ -87,7 +87,9 @@ export const RoomDirectoryBulkSaveButton = ({ selectedIds }) => {
refresh();
},
onFailure: error =>
notify("resources.room_directory.action.send_failure", "error"),
notify("resources.room_directory.action.send_failure", {
type: "error",
}),
}
);
};
@ -119,7 +121,9 @@ export const RoomDirectorySaveButton = ({ record }) => {
refresh();
},
onFailure: error =>
notify("resources.room_directory.action.send_failure", "error"),
notify("resources.room_directory.action.send_failure", {
type: "error",
}),
}
);
};

View file

@ -81,7 +81,9 @@ export const ServerNoticeButton = ({ record }) => {
handleDialogClose();
},
onFailure: () =>
notify("resources.servernotices.action.send_failure", "error"),
notify("resources.servernotices.action.send_failure", {
type: "error",
}),
}
);
};
@ -127,7 +129,9 @@ export const ServerNoticeBulkButton = ({ selectedIds }) => {
handleDialogClose();
},
onFailure: error =>
notify("resources.servernotices.action.send_failure", "error"),
notify("resources.servernotices.action.send_failure", {
type: "error",
}),
}
);
};

View file

@ -127,7 +127,9 @@ export const DeleteMediaButton = props => {
handleDialogClose();
},
onFailure: () =>
notify("resources.delete_media.action.send_failure", "error"),
notify("resources.delete_media.action.send_failure", {
type: "error",
}),
}
);
};
@ -170,7 +172,9 @@ export const ProtectMediaButton = props => {
refresh();
},
onFailure: () =>
notify("resources.protect_media.action.send_failure", "error"),
notify("resources.protect_media.action.send_failure", {
type: "error",
}),
}
);
};
@ -184,7 +188,9 @@ export const ProtectMediaButton = props => {
refresh();
},
onFailure: () =>
notify("resources.protect_media.action.send_failure", "error"),
notify("resources.protect_media.action.send_failure", {
type: "error",
}),
}
);
};
@ -262,7 +268,9 @@ export const QuarantineMediaButton = props => {
refresh();
},
onFailure: () =>
notify("resources.quarantine_media.action.send_failure", "error"),
notify("resources.quarantine_media.action.send_failure", {
type: "error",
}),
}
);
};
@ -276,7 +284,9 @@ export const QuarantineMediaButton = props => {
refresh();
},
onFailure: () =>
notify("resources.quarantine_media.action.send_failure", "error"),
notify("resources.quarantine_media.action.send_failure", {
type: "error",
}),
}
);
};