import { actionPromise } from '.';
import gql from '../api';

const actionChangeGoodsInCat = (_id, name, goods) => {
  return actionPromise('changeGoodsInCat ', gql(`
    mutation changeGoodsInCat($category:CategoryInput){
      CategoryUpsert(category:$category){
        _id name goods{
          name _id
        }
      }
    }`, {
    category: {
      _id,
      name,
      goods
    }
  }));
};

export default actionChangeGoodsInCat;
