Rename save to onSubmit in SimpleForm

https: //marmelab.com/react-admin/Upgrade.html#the-form-components-save-prop-has-been-renamed-to-onsubmit

Change-Id: Iaf2c0b665c8058336d4df6326531780a2790e71d
This commit is contained in:
dklimpel 2024-02-05 22:23:09 +01:00 committed by Manuel Stahl
parent b8a0b4bef5
commit 6430aca02b
2 changed files with 6 additions and 10 deletions

View File

@ -23,7 +23,7 @@ import {
DialogTitle,
} from "@mui/material";
const ServerNoticeDialog = ({ open, loading, onClose, onSend }) => {
const ServerNoticeDialog = ({ open, loading, onClose, onSubmit }) => {
const translate = useTranslate();
const ServerNoticeToolbar = props => (
@ -50,7 +50,7 @@ const ServerNoticeDialog = ({ open, loading, onClose, onSend }) => {
<SimpleForm
toolbar={<ServerNoticeToolbar />}
redirect={false}
onSubmit={onSend}
onSubmit={onSubmit}
>
<TextInput
source="body"
@ -105,7 +105,7 @@ export const ServerNoticeButton = () => {
<ServerNoticeDialog
open={open}
onClose={handleDialogClose}
onSend={handleSend}
onSubmit={handleSend}
/>
</>
);
@ -150,7 +150,7 @@ export const ServerNoticeBulkButton = () => {
<ServerNoticeDialog
open={open}
onClose={handleDialogClose}
onSend={handleSend}
onSubmit={handleSend}
/>
</>
);

View File

@ -29,7 +29,7 @@ import LockIcon from "@mui/icons-material/Lock";
import LockOpenIcon from "@mui/icons-material/LockOpen";
import { alpha, useTheme } from "@mui/material/styles";
const DeleteMediaDialog = ({ open, loading, onClose, onSend }) => {
const DeleteMediaDialog = ({ open, loading, onClose, onSubmit }) => {
const translate = useTranslate();
const dateParser = v => {
@ -61,11 +61,7 @@ const DeleteMediaDialog = ({ open, loading, onClose, onSend }) => {
<DialogContentText>
{translate("resources.delete_media.helper.send")}
</DialogContentText>
<SimpleForm
toolbar={<DeleteMediaToolbar />}
redirect={false}
save={onSend}
>
<SimpleForm toolbar={<DeleteMediaToolbar />} onSubmit={onSubmit}>
<DateTimeInput
fullWidth
source="before_ts"