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

13 lines
308 B
JavaScript

const updateSettings = ( operations ) => ( settingFields ) => {
const resourceKey = 'settings';
Object.keys( settingFields ).map( ( group ) =>
operations.update( [ resourceKey + '/' + group ], {
[ resourceKey + '/' + group ]: settingFields[ group ],
} )
);
};
export default {
updateSettings,
};