actionOrdersPage.js 657 B

1234567891011121314151617
  1. import { put, take } from "redux-saga/effects";
  2. import { actionFeedClear, actionFeedOrders, actionPromiseClear } from "../reducers";
  3. export const actionOrdersPage = ({ orderBy = "_id", status = "0" } = {}) => ({ type: "ORDERS_PAGE", payload: { orderBy, status } });
  4. export function* ordersPageWorker(action) {
  5. const { orderBy = "_id", status = "0" } = action.payload || {};
  6. yield put(actionFeedClear());
  7. yield put(actionPromiseClear("feedOrdersAll"));
  8. yield put(actionFeedOrders({ skip: 0, orderBy, status }));
  9. yield take("ORDERS_PAGE_CLEAR");
  10. yield put(actionFeedClear());
  11. yield put(actionPromiseClear("feedOrdersAll"));
  12. }