woocommerce/plugins/woocommerce-admin/client/wc-api/items/mutations.js

16 lines
350 B
JavaScript

/** @format */
/**
* Internal dependencies
*/
import { getResourceName } from '../utils';
const updateItem = operations => ( type, id, itemData ) => {
const resourceName = getResourceName( `items-query-${ type }-item`, id );
operations.update( [ resourceName ], { [ resourceName ]: { id, ...itemData } } );
};
export default {
updateItem,
};