Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions admin/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,8 @@ const myApiDocumentationParser = entrypoint => parseHydraDocumentation(entrypoin
src: value
});

field.field = (
<FunctionField
key={field.name}
render={
record => (
<ImageField key={field.name} record={record} source={`${field.name}.src`}/>
)
}
source={field.name}
/>
field.field = props => (
<ImageField {...props} source={`${field.name}.src`} />
);

field.input = (
Expand All @@ -168,9 +160,9 @@ const myApiDocumentationParser = entrypoint => parseHydraDocumentation(entrypoin
);

field.normalizeData = value => {
if (value[0] && value[0].rawFile instanceof File) {
if (value && value.rawFile instanceof File) {
const body = new FormData();
body.append('file', value[0].rawFile);
body.append('file', value.rawFile);

return fetch(`${entrypoint}/images/upload`, { body, method: 'POST' })
.then(response => response.json());
Expand Down