ActionOrderFind.js 718 B

123456789101112131415161718192021222324252627
  1. import {actionPromise} from "../reducers/PromiseReducer";
  2. import {gql} from "./PathDB";
  3. import {actionMyOrder} from "../reducers/MyOrdersReducer";
  4. const actionOrderFind = () => {
  5. return actionPromise('orderFind', gql(`query orderFind {
  6. OrderFind(query:"[{}]") {
  7. _id total createdAt orderGoods{
  8. _id count price good{
  9. _id name description images{
  10. _id url
  11. }
  12. }
  13. }
  14. }
  15. }`)
  16. )
  17. }
  18. export const actionFullOrderFind = () =>
  19. async dispatch => {
  20. let value = await dispatch(actionOrderFind())
  21. if (value){
  22. dispatch(actionMyOrder(value))
  23. }
  24. }