actionCatByIdFull.js 522 B

123456789101112
  1. import { actionFeedClear, actionPromiseClear } from "../reducers";
  2. import { actionFeedCategoryGoods } from "../reducers/feedReducer";
  3. import { actionCatById } from "./actionCatById";
  4. export const actionCatByIdFull =
  5. ({ _id, orderBy }) =>
  6. async (dispatch, getState) => {
  7. const category = await dispatch(actionCatById({ _id }));
  8. dispatch(actionFeedClear());
  9. dispatch(actionPromiseClear("feedCategoryGoods"));
  10. dispatch(actionFeedCategoryGoods({ category, orderBy, skip: 0 }));
  11. };