123456789101112131415161718192021222324 |
- import { actionPromise, actionCatById } from ".";
- import gql from "../api";
- const actionChangeOneGood = (_id, _idCat, name, description, price, idImg) =>
- async (dispatch) => {
- await dispatch(actionPromise('changeGood', gql(`mutation changeGood($good:GoodInput){
- GoodUpsert(good:$good){
- _id name
- }
- }`, {
- "good":{
- "_id": _id,
- "description": description,
- "name": name,
- "price": +price,
- // "images": [{"_id": idImg}]
- "images": idImg,
- }
- })))
- dispatch(actionCatById(_idCat)); console.log('_idCattttttt', _idCat)
- }
- export default actionChangeOneGood;
|