Skip to content
Snippets Groups Projects
Commit e0ae33d4 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

fix(submitRevision): submit revision hotfix

parent a56b5525
No related branches found
No related tags found
No related merge requests found
import { actions } from 'pubsweet-client'
import { get, debounce, omit, set, isEqual } from 'lodash'
import { get, debounce, omit, set } from 'lodash'
import { handleError } from 'pubsweet-component-faraday-ui'
import { autosaveRequest } from 'pubsweet-component-wizard/src/redux/autosave'
import { submitRevision } from 'pubsweet-component-wizard/src/redux/conversion'
......@@ -14,12 +14,10 @@ const parseRevision = (values, fragment) => ({
const _onChange = (values, dispatch, { collection, fragment }) => {
const newValues = omit(values, 'editAuthors')
if (!isEqual(newValues, fragment.revision)) {
dispatch(autosaveRequest())
dispatch(
actions.updateFragment(collection, parseRevision(values, fragment)),
)
}
dispatch(autosaveRequest())
dispatch(
actions.updateFragment(collection, parseRevision(newValues, fragment)),
)
}
export const onChange = debounce(_onChange, 1000, { maxWait: 5000 })
......
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