blob: e187b765fe7b1e4c85c4b83be3e24eaf734cc3c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
import { call, put } from 'redux-saga/effects'
import { deleteCurrentUserSucceeded } from '../actions/users'
import { deleteUser } from '../../api/users'
export function* onDeleteCurrentUser(action) {
try {
yield call(deleteUser, action.userId)
yield put(deleteCurrentUserSucceeded())
} catch (error) {
console.error(error)
}
}
|