Open MaximeDetaille opened 1 year ago
same question, use the sample , Article entity, if we dont upload thumbmail image, it will failed in create Article
@MaximeDetaille in latest 5.1.3 version (or maybe older) you suppose to use 'transform' method like here:
import { CardActions } from '@mui/material';
import { Create, ListButton, SaveButton, SimpleForm, TextInput, Toolbar, required } from 'react-admin';
const transformUser = data => ({
data,
});
const CustomToolbar = props => {
return (
<Toolbar {...props} style={{ display: 'flex', justifyContent: 'flex-end' }}>
<SaveButton type="button" transform={transformUser} />
</Toolbar>
)
};
export const SchemeCreate = (props) => (
<Create {...props}>
<SimpleForm style={{ width: '90vw' }} toolbar={<CustomToolbar />}>
<TextInput fullWidth source="name" validate={[required()]} />
<TextInput fullWidth source="defaultPrompt" multiline rows={5} />
</SimpleForm>
</Create>
);
Hello,
Im using your provider for strapi and when i want to create a ressource i got an error from strapi because "data" is missing from request
I updated your provider for making working it by updating this line
By this one
And all working well. But i really dont know if im doing good ...