import {takeLatest} from 'redux-saga';
import {take, call, put, fork, cancel, select, race} from 'redux-saga/effects';
import {fetchList, fetchItem, createItem, updateItem} from '../services/announcement';
import {message} from 'antd';
import {watchIndex, watchShow, watchCreate, watchUpdate, watchEdit, watch} from './RESTful';

export default function*() {
    const ID = 'ANNOUNCEMENT';
    yield fork(watchCreate(ID, createItem));
    yield fork(watchIndex(ID, fetchList));
    yield fork(watchShow(ID, fetchItem));
    yield fork(watchEdit(ID, updateItem));
    yield fork(watch('UPDATE_ANNOUNCEMENT_ITEM_STATUS', updateItem));
}
