mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 00:34:26 +01:00
Remove /experimental-features
verbs that weren't in the PRD
This commit is contained in:
parent
9deeec88e0
commit
68356869c0
@ -18,9 +18,7 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
|
|||||||
cfg.service(
|
cfg.service(
|
||||||
web::resource("")
|
web::resource("")
|
||||||
.route(web::get().to(SeqHandler(get_features)))
|
.route(web::get().to(SeqHandler(get_features)))
|
||||||
.route(web::patch().to(SeqHandler(patch_features)))
|
.route(web::patch().to(SeqHandler(patch_features))),
|
||||||
.route(web::delete().to(SeqHandler(delete_features)))
|
|
||||||
.route(web::post().to(SeqHandler(post_features))),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,40 +68,3 @@ async fn patch_features(
|
|||||||
index_scheduler.put_runtime_features(new_features)?;
|
index_scheduler.put_runtime_features(new_features)?;
|
||||||
Ok(HttpResponse::Ok().json(new_features))
|
Ok(HttpResponse::Ok().json(new_features))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn post_features(
|
|
||||||
index_scheduler: GuardedData<
|
|
||||||
ActionPolicy<{ actions::EXPERIMENTAL_FEATURES_UPDATE }>,
|
|
||||||
Data<IndexScheduler>,
|
|
||||||
>,
|
|
||||||
new_features: AwebJson<RuntimeTogglableFeatures, DeserrJsonError>,
|
|
||||||
analytics: Data<dyn Analytics>,
|
|
||||||
req: HttpRequest,
|
|
||||||
) -> Result<HttpResponse, ResponseError> {
|
|
||||||
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<IndexScheduler>,
|
|
||||||
>,
|
|
||||||
analytics: Data<dyn Analytics>,
|
|
||||||
req: HttpRequest,
|
|
||||||
) -> Result<HttpResponse, ResponseError> {
|
|
||||||
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))
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user