File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -149,16 +149,8 @@ const myApiDocumentationParser = entrypoint => parseHydraDocumentation(entrypoin
149
149
src: value
150
150
});
151
151
152
- field.field = (
153
- <FunctionField
154
- key={field.name}
155
- render={
156
- record => (
157
- <ImageField key={field.name} record={record} source={` ${field.name}.src`}/>
158
- )
159
- }
160
- source={field.name}
161
- />
152
+ field.field = props => (
153
+ <ImageField {...props} source={` ${field.name}.src`} />
162
154
);
163
155
164
156
field.input = (
@@ -168,9 +160,9 @@ const myApiDocumentationParser = entrypoint => parseHydraDocumentation(entrypoin
168
160
);
169
161
170
162
field.normalizeData = value => {
171
- if (value[0] && value[0] .rawFile instanceof File) {
163
+ if (value && value.rawFile instanceof File) {
172
164
const body = new FormData();
173
- body.append('file', value[0] .rawFile);
165
+ body.append('file', value.rawFile);
174
166
175
167
return fetch(`${entrypoint}/images/upload`, { body, method : ' POST' })
176
168
.then(response => response.json());
You can’t perform that action at this time.
0 commit comments