mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
🐛 Fix webhook retrieval via REST
This commit is contained in:
parent
e6fef4a6f5
commit
9101c1830b
2 changed files with 5 additions and 5 deletions
|
@ -23,7 +23,9 @@ export const resolvers = {
|
||||||
const result = yield apiFetch( { path: REST_HYDRATE_PATH } );
|
const result = yield apiFetch( { path: REST_HYDRATE_PATH } );
|
||||||
const webhooks = yield apiFetch( { path: REST_WEBHOOKS } );
|
const webhooks = yield apiFetch( { path: REST_WEBHOOKS } );
|
||||||
|
|
||||||
result.data = { ...result.data, ...webhooks.data };
|
if ( webhooks.success && webhooks.data ) {
|
||||||
|
result.webhooks = webhooks.data;
|
||||||
|
}
|
||||||
|
|
||||||
yield dispatch( STORE_NAME ).hydrate( result );
|
yield dispatch( STORE_NAME ).hydrate( result );
|
||||||
yield dispatch( STORE_NAME ).setIsReady( true );
|
yield dispatch( STORE_NAME ).setIsReady( true );
|
||||||
|
|
|
@ -135,10 +135,8 @@ class WebhookSettingsEndpoint extends RestEndpoint {
|
||||||
|
|
||||||
return $this->return_success(
|
return $this->return_success(
|
||||||
array(
|
array(
|
||||||
'webhooks' => array(
|
'url' => $webhook_url,
|
||||||
'url' => $webhook_url,
|
'events' => $webhook_events,
|
||||||
'events' => $webhook_events,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue