mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
♻️ Move REST paths to constants.js
This commit is contained in:
parent
84d2af5f39
commit
ab8f8e81ae
2 changed files with 12 additions and 1 deletions
|
@ -2,13 +2,14 @@ import { dispatch } from '@wordpress/data';
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { apiFetch } from '@wordpress/data-controls';
|
||||
import { NAMESPACE } from '../constants';
|
||||
import { REST_HYDRATE_PATH } from './constants';
|
||||
import { setIsReady, setOnboardingDetails } from './actions';
|
||||
|
||||
/**
|
||||
* Retrieve settings from the site's REST API.
|
||||
*/
|
||||
export function* getPersistentData() {
|
||||
const path = `${ NAMESPACE }/onboarding`;
|
||||
const path = `${ NAMESPACE }/${ REST_HYDRATE_PATH }`;
|
||||
|
||||
try {
|
||||
const result = yield apiFetch( { path } );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue