2019-03-28 17:38:44 +00:00
|
|
|
/** @format */
|
|
|
|
|
2019-04-01 22:16:51 +00:00
|
|
|
/**
|
|
|
|
* 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 } } );
|
2019-03-28 17:38:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
updateItem,
|
|
|
|
};
|