fix: Update email action should hit API

This commit is contained in:
Mrugesh Mohapatra
2017-12-05 11:55:41 +05:30
parent 35f0b4f0d7
commit 885d5916c0
6 changed files with 15 additions and 9 deletions

View File

@@ -6,7 +6,6 @@ import { makeToast } from '../../../Toasts/redux';
import {
fetchChallenges,
doActionOnError,
userSelector
} from '../../../redux';
import {
@@ -41,7 +40,7 @@ export function updateUserEmailEpic(actions, { getState }) {
const ajaxUpdate = postJSON$('/update-my-email', body)
.map(({ message }) => makeToast({ message }))
.catch(doActionOnError(() => oldEmail ?
updateUserFlag(username, oldEmail) :
updateUserEmail(username, oldEmail) :
null
));
return Observable.merge(optimisticUpdate, ajaxUpdate);