actionAdminOrderPage.js 560 B

1234567891011121314151617
  1. import { actionPromiseClear } from "../reducers";
  2. import { actionGoodsAll } from "./actionGoodsAll";
  3. import { actionOrderById } from "./actionOrderById";
  4. import { actionUsersAll } from "./actionUsersAll";
  5. export const actionAdminOrderPage =
  6. ({ _id }) =>
  7. async (dispatch, getState) => {
  8. dispatch(actionUsersAll());
  9. dispatch(actionGoodsAll());
  10. if (_id) {
  11. dispatch(actionOrderById({ _id, promiseName: "adminOrderById" }));
  12. } else {
  13. dispatch(actionPromiseClear("adminOrderById"));
  14. }
  15. };