import {actionPromise, gql} from "./index";


const actionGoodUpdate = (data) => {
    return async dispatch => {
        const queryJson = JSON.stringify(
            {
                good: data
            }
        )
        await dispatch(actionPromise("newGood", gql(
            `mutation updateGood($good:GoodInput) {
                GoodUpsert(good: $good) {
                    _id
                    name
                    description
                    price
                    images{url}
                    
                }
              }`, queryJson
        )))
    }
}

export default actionGoodUpdate;