Skip to content

Commit

Permalink
Add todos related to store_url_metric()
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Aug 22, 2024
1 parent 7787fa4 commit 07273df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ static function ( $url_metric_data ) use ( $trigger_warning ) {
* Stores URL metric by merging it with the other URL metrics which share the same normalized query vars.
*
* @since 0.1.0
* @todo There is duplicate logic here with od_handle_rest_request().
*
* @param string $slug Slug (hash of normalized query vars).
* @param OD_URL_Metric $new_url_metric New URL metric.
Expand Down
1 change: 1 addition & 0 deletions plugins/optimization-detective/storage/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function od_handle_rest_request( WP_REST_Request $request ) {
);
}

// TODO: This should be changed from store_url_metric($slug, $url_metric) instead be update_post( $slug, $group_collection ). As it stands, store_url_metric() is duplicating logic here.
$result = OD_URL_Metrics_Post_Type::store_url_metric(
$request->get_param( 'slug' ),
$url_metric
Expand Down

0 comments on commit 07273df

Please sign in to comment.