Skip to content
Snippets Groups Projects
Commit 2b6da25c authored by Sebastian Mihalache's avatar Sebastian Mihalache
Browse files

Merge branch 'develop' of gitlab.coko.foundation:xpub/xpub-faraday into develop

parents 3dbfa9cd a7ba9169
No related branches found
No related tags found
1 merge request!14Sprint #15
import { actions } from 'pubsweet-client' import { actions } from 'pubsweet-client'
import { SubmissionError } from 'redux-form' import { SubmissionError } from 'redux-form'
import { get, find, capitalize, pick } from 'lodash' import { get, find, capitalize, pick } from 'lodash'
import { update } from 'pubsweet-client/src/helpers/api' import { update, create } from 'pubsweet-client/src/helpers/api'
export const parseTitle = version => { export const parseTitle = version => {
const title = get(version, 'metadata.title') const title = get(version, 'metadata.title')
...@@ -147,9 +147,12 @@ export const onSubmitUser = (values, dispatch, { setEditMode }) => ...@@ -147,9 +147,12 @@ export const onSubmitUser = (values, dispatch, { setEditMode }) =>
}) })
.catch(handleFormError) .catch(handleFormError)
// Temporary till API implementation export const onSubmitChangePassword = (
export const onSubmitChangePassword = (values, dispatch, { history, user }) => { password, newPassword },
update(`/users/${values.id}`, parseUpdateUser(values)) dispatch,
{ history },
) =>
create(`/users/change-password`, { password, newPassword })
.then(() => { .then(() => {
history.goBack() history.goBack()
}) })
......
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