actionWishSearch.js 573 B

12345678910111213141516171819202122232425262728
  1. import actionPromise from "./actionPromise";
  2. import {gql} from "./";
  3. const actionWishes = (arr) => {
  4. return async dispatch => {
  5. const queryJson = JSON.stringify(
  6. [{"$or" : arr}]
  7. )
  8. await dispatch(actionPromise("wishesSearch", gql(
  9. `query wishesGoods($query: String) {
  10. GoodFind(query: $query) {
  11. name
  12. _id
  13. images{url}
  14. price
  15. }
  16. }`, {query: queryJson}
  17. )))
  18. }
  19. }
  20. export default actionWishes;