Skip to content
Snippets Groups Projects
Commit e94f2039 authored by john's avatar john
Browse files

use patch for updating content with an ink import

parent e1d163c6
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment