%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/emergentqj/actioncivile/pre-auth/.632e77b3fb93bc8da5b589b869bc0037/static/js/sagas/
Upload File :
Create Path :
Current File : /home/emergentqj/actioncivile/pre-auth/.632e77b3fb93bc8da5b589b869bc0037/static/js/sagas/logOut.js

import { put, call, takeEvery } from "redux-saga/effects";

import LIST_ACTIONS from "constants/action_types";
import { deleteDataAction } from "common/actions";
import configFunc from "config/config";

const config = configFunc();

function* runLogOut() {
  try {
    yield call(deleteDataAction(`${config.apiUrl}logout`, null, true));

    yield put({
      type: LIST_ACTIONS.LOGOUT_SUCCESS,
    });
  } catch (e) {
    yield put({
      type: LIST_ACTIONS.LOGOUT_ERROR,
      e,
    });
  }
}

export default function* logOut(dispatch) {
  yield takeEvery(LIST_ACTIONS.LOGOUT_REQUEST, runLogOut, dispatch);
}

Zerion Mini Shell 1.0