({ payload: { page = 1 } }, { call, put })
| 14 | }, |
| 15 | effects: { |
| 16 | *fetch({ payload: { page = 1 } }, { call, put }) { |
| 17 | const { data, headers } = yield call(usersService.fetch, { page }); |
| 18 | yield put({ |
| 19 | type: 'save', |
| 20 | payload: { |
| 21 | data, |
| 22 | total: parseInt(headers['x-total-count'], 10), |
| 23 | page: parseInt(page, 10), |
| 24 | }, |
| 25 | }); |
| 26 | }, |
| 27 | *remove({ payload: id }, { call, put }) { |
| 28 | yield call(usersService.remove, id); |
| 29 | yield put({ type: 'reload' }); |