-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Settings UI: Implement logic for features and refresh button.
- Loading branch information
Showing
11 changed files
with
283 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { | |
REST_MANUAL_CONNECTION_PATH, | ||
REST_CONNECTION_URL_PATH, | ||
REST_HYDRATE_MERCHANT_PATH, | ||
REST_REFRESH_FEATURES_PATH, | ||
} from './constants'; | ||
import ACTION_TYPES from './action-types'; | ||
|
||
|
@@ -121,4 +122,27 @@ export const controls = { | |
|
||
return result; | ||
}, | ||
|
||
async [ ACTION_TYPES.DO_REFRESH_FEATURES ]() { | ||
let result = null; | ||
|
||
try { | ||
result = await apiFetch( { | ||
path: REST_REFRESH_FEATURES_PATH, | ||
method: 'POST', | ||
} ); | ||
|
||
if ( result.success ) { | ||
This comment has been minimized.
Sorry, something went wrong.
stracker-phil
Collaborator
|
||
result = await dispatch( STORE_NAME ).refreshMerchantData(); | ||
} | ||
} catch ( e ) { | ||
result = { | ||
success: false, | ||
error: e, | ||
message: e.message, | ||
}; | ||
} | ||
|
||
return result; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Please use the
COMMON:
prefix for the action type value, i.e.DO_REFRESH_FEATURES: 'COMMON:DO_REFRESH_FEATURES',