From e94f203991d8142bf17988f97387f5bd30830624 Mon Sep 17 00:00:00 2001 From: john <johnbarlas39@gmail.com> Date: Sat, 22 Apr 2017 13:57:06 +0300 Subject: [PATCH] use patch for updating content with an ink import --- .../BookBuilder/Chapter/UploadButton.jsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/components/BookBuilder/Chapter/UploadButton.jsx b/app/components/BookBuilder/Chapter/UploadButton.jsx index 3b233be..3284641 100644 --- a/app/components/BookBuilder/Chapter/UploadButton.jsx +++ b/app/components/BookBuilder/Chapter/UploadButton.jsx @@ -11,18 +11,17 @@ export class UploadButton extends React.Component { event.preventDefault() const file = event.target.files[0] - const { - chapter, - convertFile, - toggleUpload, - update - } = this.props + const { chapter, convertFile, toggleUpload, update } = this.props toggleUpload() convertFile(file).then(response => { - chapter.source = response.converted - update(chapter) + const patch = { + id: chapter.id, + source: response.converted + } + + update(patch) toggleUpload() }).catch((error) => { console.error('INK error', error) -- GitLab