admin reducer
?
用例
我试图创建一个自定义编辑,并从服务器获取一个响应来更新上的实体
redux-store
更新:
在中单击“编辑”按钮后,我使用对话框执行某些操作
<List>
对话框将出现,我试图做的是调度操作以更新中的记录
const enhance = compose(
withHandlers({
onExit: ({ onClose }) => () => {
onClose('addSection');
},
}),
withHandlers({
onSave: ({ onExit, id }) => values => {
restClient(CREATE, 'sections', {
data: {
name: values.name,
content: values.content,
status: true,
survey_id: id,
},
}).then(() => onExit());
},
}),
branch(props => !props.isOpen, renderNothing),
);
const EditQuestionDialog = enhance(
({ isOpen, onExit, onSave, onChange, data }) => {
return (
<div>
<Dialog open={isOpen} onRequestClose={onExit} modal>
<SimpleForm save={onSave} redirect="list">
<TextInput source="name" />
<TextInput source="content" />
</SimpleForm>
</Dialog>
</div>
);
},
);