16 lines
350 B
JavaScript
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,
|
|
};
|