[REST API] Fixed links for settings endpoint

Do not allow embed and updated the key to reflect the items from the endpoint response
This commit is contained in:
Claudio Sanches 2017-03-24 01:54:59 -03:00
parent 39e1fd9fc3
commit 7381b008e0
2 changed files with 6 additions and 9 deletions

View File

@ -97,9 +97,8 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
protected function prepare_links( $group_id ) {
$base = '/' . $this->namespace . '/' . $this->rest_base;
$links = array(
'item' => array(
'href' => rest_url( trailingslashit( $base ) . $group_id ),
'embeddable' => true,
'options' => array(
'href' => rest_url( trailingslashit( $base ) . $group_id ),
),
);

View File

@ -52,10 +52,9 @@ class Settings extends WC_REST_Unit_Test_Case {
'description' => 'My awesome test settings.',
'sub_groups' => array( 'sub-test' ),
'_links' => array(
'item' => array(
'options' => array(
array(
'href' => rest_url( '/wc/v2/settings/test' ),
'embeddable' => true,
'href' => rest_url( '/wc/v2/settings/test' ),
),
),
),
@ -68,10 +67,9 @@ class Settings extends WC_REST_Unit_Test_Case {
'description' => '',
'sub_groups' => array(),
'_links' => array(
'item' => array(
'options' => array(
array(
'href' => rest_url( '/wc/v2/settings/sub-test' ),
'embeddable' => true,
'href' => rest_url( '/wc/v2/settings/sub-test' ),
),
),
),