actionGoodsPopular.js 820 B

123456789101112131415161718192021222324252627282930
  1. import { gql } from "../helpers";
  2. import { actionPromise } from "../reducers";
  3. export const actionGoodsPopular = () => async (dispatch, getState) => {
  4. dispatch(
  5. actionPromise(
  6. "goodsPopular",
  7. gql(
  8. `query GoodsPopular($query:String){
  9. GoodFind(query: $query){
  10. _id name price amount
  11. images{
  12. _id url
  13. }
  14. }
  15. }`,
  16. {
  17. query: JSON.stringify([
  18. {},
  19. {
  20. limit: 15,
  21. orderBy: "popular",
  22. },
  23. ]),
  24. }
  25. )
  26. )
  27. );
  28. };