From a4716c7ff17e69d9039cadaa2c597a700db56455 Mon Sep 17 00:00:00 2001 From: baudev Date: Fri, 22 Feb 2019 22:17:04 +0100 Subject: [PATCH] Fix bugs in Managing Files and Images code --- admin/getting-started.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/admin/getting-started.md b/admin/getting-started.md index a12051655ec..835dd954762 100644 --- a/admin/getting-started.md +++ b/admin/getting-started.md @@ -149,16 +149,8 @@ const myApiDocumentationParser = entrypoint => parseHydraDocumentation(entrypoin src: value }); - field.field = ( - ( - - ) - } - source={field.name} - /> + field.field = props => ( + ); field.input = ( @@ -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());