actionOrdersFind.js 688 B

123456789101112131415161718192021222324252627282930
  1. import {actionPromise, gql} from "./index";
  2. const actionOrdersFind = (data) => {
  3. return async dispatch => {
  4. const queryJson = JSON.stringify(
  5. [{"___owner" : data}]
  6. )
  7. await dispatch(actionPromise("ordersFind", gql (
  8. `query orders ($query: String) {
  9. OrderFind(query: $query){
  10. total
  11. _id
  12. orderGoods {count, _id, price, good {name, price}}
  13. createdAt
  14. owner {
  15. login
  16. }
  17. }
  18. }`, {query: queryJson}
  19. )))
  20. }
  21. }
  22. export default actionOrdersFind;