UNPKG

@shopgate/pwa-common-commerce

Version:

Commerce library for the Shopgate Connect PWA.

22 lines (21 loc) 626 B
import { logger } from '@shopgate/pwa-core'; import { UPDATE_METADATA } from "../constants"; /** * Changes the metadata of an existing product in the store. * @param {string} productId The product ID to change the metadata for. * @param {Object} [metadata=null] The metadata to update. * @returns {Function} A redux thunk. * @deprecated */ const updateMetaData = (productId, metadata = null) => dispatch => { if (!metadata) { logger.warn('updateMetaData was called without new metadata!'); return; } dispatch({ type: UPDATE_METADATA, productId, metadata }); }; export default updateMetaData;