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

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