actionCategoryUpsert.js 725 B

123456789101112131415161718192021222324
  1. import { gql } from "../helpers";
  2. import { actionPromise } from "../reducers";
  3. export const actionCategoryUpsert = (category) =>
  4. actionPromise(
  5. "categoryUpsert",
  6. gql(
  7. `mutation CatUpsert($category:CategoryInput!){
  8. CategoryUpsert(category:$category){
  9. _id name
  10. parent{
  11. _id, name
  12. }
  13. subcategories{
  14. _id name
  15. }
  16. goods{
  17. _id name price amount
  18. }
  19. }
  20. }`,
  21. { category }
  22. )
  23. );