summaryrefslogtreecommitdiff
path: root/src/sagas/profile.js
blob: 6a72e7c2a7aa2b98b120512e7bf2bfa3d85d4b70 (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/routes/users";

export function* onDeleteCurrentUser(action) {
    try {
        yield call(deleteUser, action.userId);
        yield put(deleteCurrentUserSucceeded());
    } catch (error) {
        console.log(error);
    }
}