[#3176] REST API webhooks endpoint tweaks from unit test
This commit is contained in:
parent
4cffe3182f
commit
38dd928f23
|
@ -319,7 +319,7 @@ class WC_API_Webhooks extends WC_API_Resource {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
list( $resource, $event ) = explode( '.', $topic );
|
@list( $resource, $event ) = explode( '.', $topic );
|
||||||
|
|
||||||
if ( ! isset( $resource ) || ! isset( $event ) ) {
|
if ( ! isset( $resource ) || ! isset( $event ) ) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -476,7 +476,7 @@ class WC_API_Webhooks extends WC_API_Resource {
|
||||||
$id = absint( $id );
|
$id = absint( $id );
|
||||||
|
|
||||||
if ( empty( $id ) ) {
|
if ( empty( $id ) ) {
|
||||||
return new WP_Error( 'woocommerce_api_invalid_webhook_delivery_id', __( 'Invalid webhook delivery ID', 'woocommerce' ), array( 'status' => 400 ) );
|
return new WP_Error( 'woocommerce_api_invalid_webhook_delivery_id', __( 'Invalid webhook delivery ID', 'woocommerce' ), array( 'status' => 404 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$webhook = new WC_Webhook( $webhook_id );
|
$webhook = new WC_Webhook( $webhook_id );
|
||||||
|
|
Loading…
Reference in New Issue