| | |
| | | NumberInput, |
| | | TextInput, |
| | | useTranslate, |
| | | useResourceContext, |
| | | } from 'react-admin'; |
| | | import { Dialog, DialogActions, DialogContent, DialogTitle, Grid, Stack, Divider } from '@mui/material'; |
| | | import UpdateIcon from '@mui/icons-material/Update'; |
| | |
| | | import ContentSave from '@mui/icons-material/Save'; |
| | | import CloseIcon from '@mui/icons-material/Close'; |
| | | |
| | | const BulkUpdateButton = ({ resource, label = 'ra.action.update', ...rest }) => { |
| | | const BulkUpdateButton = ({ label = 'ra.action.update' }) => { |
| | | const [open, setOpen] = useState(false); |
| | | |
| | | const refresh = useRefresh(); |
| | | const notify = useNotify(); |
| | | const translate = useTranslate(); |
| | | const resource = useResourceContext(); |
| | | const unselectAll = useUnselectAll(resource); |
| | | const { selectedIds } = useListContext(); |
| | | |
| | |
| | | const [updateMany, { loading }] = useUpdateMany(); |
| | | |
| | | const handleSubmit = (data) => { |
| | | delete filteredData['memoWrap']; |
| | | const filteredData = Object.fromEntries( |
| | | Object.entries(data).filter(([key, value]) => value !== null && value !== undefined) |
| | | ); |
| | | delete filteredData['memoWrap']; |
| | | if (Object.keys(filteredData).length > 0) { |
| | | updateMany( |
| | | resource, |