mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
New Settings UI: Move request chaining fom control to action
This commit is contained in:
parent
fa2571f44b
commit
f31b78f91c
1 changed files with 9 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
|||
* @file
|
||||
*/
|
||||
|
||||
import { select } from '@wordpress/data';
|
||||
import { dispatch, select } from '@wordpress/data';
|
||||
|
||||
import ACTION_TYPES from './action-types';
|
||||
import { STORE_NAME } from './constants';
|
||||
|
@ -192,11 +192,17 @@ export const refreshMerchantData = function* () {
|
|||
|
||||
/**
|
||||
* Side effect.
|
||||
* Purges all features status data via a REST request.
|
||||
* Purges all feature status data via a REST request.
|
||||
* Refreshes the merchant data via a REST request.
|
||||
*
|
||||
* @return {Action} The action.
|
||||
*/
|
||||
export const refreshFeatureStatuses = function* () {
|
||||
return yield { type: ACTION_TYPES.DO_REFRESH_FEATURES };
|
||||
const result = yield { type: ACTION_TYPES.DO_REFRESH_FEATURES };
|
||||
|
||||
if ( result && result.success ) {
|
||||
return yield dispatch( STORE_NAME ).refreshMerchantData();
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue