actionOrders.js 733 B

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