actionOrders.js 839 B

123456789101112131415161718192021222324252627
  1. import { actionPromise } from "../reducers";
  2. import { gql } from "../helpers";
  3. export const actionOrders =
  4. ({ promiseName = "orders" } = {}) =>
  5. (dispatch) =>
  6. dispatch(
  7. actionPromise(
  8. promiseName,
  9. gql(
  10. `
  11. query orders($query:String){
  12. OrderFind(query:$query){
  13. _id price createdAt status
  14. orderGoods{
  15. _id count price good{
  16. name _id price images{
  17. url _id
  18. }
  19. }
  20. }
  21. }
  22. }
  23. `,
  24. { query: JSON.stringify([{}, { orderBy: "-createdAt", limit: 200 }]) }
  25. )
  26. )
  27. );