save all settings (https://github.com/woocommerce/woocommerce-admin/pull/4661)
This commit is contained in:
parent
c97e9d5ad1
commit
a3b89c8867
|
@ -86,6 +86,7 @@ class StoreDetails extends Component {
|
|||
isProfileItemsError,
|
||||
updateAndPersistSettingsForGroup,
|
||||
profileItems,
|
||||
settings,
|
||||
} = this.props;
|
||||
|
||||
const currencySettings = this.deriveCurrencySettings(
|
||||
|
@ -102,6 +103,7 @@ class StoreDetails extends Component {
|
|||
|
||||
await updateAndPersistSettingsForGroup( 'general', {
|
||||
general: {
|
||||
...settings,
|
||||
woocommerce_store_address: values.addressLine1,
|
||||
woocommerce_store_address_2: values.addressLine2,
|
||||
woocommerce_default_country: values.countryState,
|
||||
|
@ -240,13 +242,14 @@ export default compose(
|
|||
getSettingsError,
|
||||
isGetSettingsRequesting,
|
||||
} = select( SETTINGS_STORE_NAME );
|
||||
const {
|
||||
getOnboardingError,
|
||||
getProfileItems
|
||||
} = select( ONBOARDING_STORE_NAME );
|
||||
const { getOnboardingError, getProfileItems } = select(
|
||||
ONBOARDING_STORE_NAME
|
||||
);
|
||||
|
||||
const profileItems = getProfileItems();
|
||||
const isProfileItemsError = Boolean( getOnboardingError( 'updateProfileItems' ) );
|
||||
const isProfileItemsError = Boolean(
|
||||
getOnboardingError( 'updateProfileItems' )
|
||||
);
|
||||
|
||||
const { general: settings = {} } = getSettings( 'general' );
|
||||
const isSettingsError = Boolean( getSettingsError( 'general' ) );
|
||||
|
|
|
@ -30,10 +30,12 @@ export default class StoreLocation extends Component {
|
|||
createNotice,
|
||||
isSettingsError,
|
||||
updateAndPersistSettingsForGroup,
|
||||
settings,
|
||||
} = this.props;
|
||||
|
||||
await updateAndPersistSettingsForGroup( 'general', {
|
||||
general: {
|
||||
...settings,
|
||||
woocommerce_store_address: values.addressLine1,
|
||||
woocommerce_store_address_2: values.addressLine2,
|
||||
woocommerce_default_country: values.countryState,
|
||||
|
|
|
@ -180,6 +180,7 @@ class Tax extends Component {
|
|||
this.setState( { isPending: true } );
|
||||
await updateAndPersistSettingsForGroup( 'general', {
|
||||
general: {
|
||||
...generalSettings,
|
||||
woocommerce_calc_taxes: 'yes',
|
||||
},
|
||||
} );
|
||||
|
@ -191,17 +192,24 @@ class Tax extends Component {
|
|||
}
|
||||
|
||||
async updateAutomatedTax() {
|
||||
const { createNotice, updateAndPersistSettingsForGroup } = this.props;
|
||||
const {
|
||||
createNotice,
|
||||
updateAndPersistSettingsForGroup,
|
||||
generalSettings,
|
||||
taxSettings,
|
||||
} = this.props;
|
||||
const { automatedTaxEnabled } = this.state;
|
||||
|
||||
await updateAndPersistSettingsForGroup( 'tax', {
|
||||
tax: {
|
||||
...taxSettings,
|
||||
wc_connect_taxes_enabled: automatedTaxEnabled ? 'yes' : 'no',
|
||||
},
|
||||
} );
|
||||
|
||||
await updateAndPersistSettingsForGroup( 'general', {
|
||||
general: {
|
||||
...generalSettings,
|
||||
woocommerce_calc_taxes: 'yes',
|
||||
},
|
||||
} );
|
||||
|
|
Loading…
Reference in New Issue