Fix path for `segment_label` in Products & Variations schema

This commit is contained in:
Tomek Wytrębowicz 2023-05-02 16:11:58 +02:00
parent fbd377b2ec
commit d35e8f3c46
2 changed files with 4 additions and 4 deletions

View File

@ -172,8 +172,8 @@ class Controller extends GenericStatsController {
'enum' => array( 'day', 'week', 'month', 'year' ),
);
$schema['properties']['totals']['properties']['segments']['items']['properties']['segment_label'] = $segment_label;
$schema['properties']['intervals']['items']['properties']['subtotals']['properties'] = $segment_label;
$schema['properties']['totals']['properties']['segments']['items']['properties']['segment_label'] = $segment_label;
$schema['properties']['intervals']['items']['properties']['subtotals']['properties']['segments']['items']['properties']['segment_label'] = $segment_label;
return $this->add_additional_fields_schema( $schema );
}

View File

@ -176,8 +176,8 @@ class Controller extends GenericStatsController {
'enum' => array( 'day', 'week', 'month', 'year' ),
);
$schema['properties']['totals']['properties']['segments']['items']['properties']['segment_label'] = $segment_label;
$schema['properties']['intervals']['items']['properties']['subtotals']['properties'] = $segment_label;
$schema['properties']['totals']['properties']['segments']['items']['properties']['segment_label'] = $segment_label;
$schema['properties']['intervals']['items']['properties']['subtotals']['properties']['segments']['items']['properties']['segment_label'] = $segment_label;
return $this->add_additional_fields_schema( $schema );
}