import {fork} from 'redux-saga/effects';
import {fetchList, fetchItem, createItem, updateItem, deleteItem} from '../services/admin/authority';
import {watch, through} from './RESTful';

export default function*() {
    yield fork(through('EDIT_AUTHORITY', updateItem, '修改'));
    yield fork(watch('CREATE_AUTHORITY', createItem, '创建'));
    yield fork(watch('DELETE_AUTHORITY', deleteItem, '删除'));
    yield fork(watch('FETCH_AUTHORITY_LIST', fetchList));
    yield fork(watch('FETCH_AUTHORITY', fetchItem));
}
