From 68356869c0ad9be2666746d85926a1edeb9d3de4 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Thu, 29 Jun 2023 10:02:55 +0200 Subject: [PATCH] Remove `/experimental-features` verbs that weren't in the PRD --- meilisearch/src/routes/features.rs | 41 +----------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/meilisearch/src/routes/features.rs b/meilisearch/src/routes/features.rs index 1b1c2c67a..de5becfd1 100644 --- a/meilisearch/src/routes/features.rs +++ b/meilisearch/src/routes/features.rs @@ -18,9 +18,7 @@ pub fn configure(cfg: &mut web::ServiceConfig) { cfg.service( web::resource("") .route(web::get().to(SeqHandler(get_features))) - .route(web::patch().to(SeqHandler(patch_features))) - .route(web::delete().to(SeqHandler(delete_features))) - .route(web::post().to(SeqHandler(post_features))), + .route(web::patch().to(SeqHandler(patch_features))), ); } @@ -70,40 +68,3 @@ async fn patch_features( index_scheduler.put_runtime_features(new_features)?; Ok(HttpResponse::Ok().json(new_features)) } - -async fn post_features( - index_scheduler: GuardedData< - ActionPolicy<{ actions::EXPERIMENTAL_FEATURES_UPDATE }>, - Data, - >, - new_features: AwebJson, - analytics: Data, - req: HttpRequest, -) -> Result { - let new_features = meilisearch_types::features::RuntimeTogglableFeatures { - score_details: new_features.0.score_details.unwrap_or(false), - vector_store: new_features.0.vector_store.unwrap_or(false), - }; - - analytics.publish("Experimental features Updated".to_string(), json!(new_features), Some(&req)); - index_scheduler.put_runtime_features(new_features)?; - Ok(HttpResponse::Ok().json(new_features)) -} - -async fn delete_features( - index_scheduler: GuardedData< - ActionPolicy<{ actions::EXPERIMENTAL_FEATURES_UPDATE }>, - Data, - >, - analytics: Data, - req: HttpRequest, -) -> Result { - let deleted_features = Default::default(); - analytics.publish( - "Experimental features Updated".to_string(), - json!(deleted_features), - Some(&req), - ); - index_scheduler.put_runtime_features(deleted_features)?; - Ok(HttpResponse::Ok().json(deleted_features)) -}