From 8aeddec9827febd51e08cccb05406d587ce00876 Mon Sep 17 00:00:00 2001 From: qdequele Date: Thu, 5 Mar 2020 15:06:18 +0100 Subject: [PATCH] remove the route to get identifier on settings; fix #502 --- meilisearch-http/src/routes/mod.rs | 3 --- meilisearch-http/src/routes/setting.rs | 13 ------------- 2 files changed, 16 deletions(-) diff --git a/meilisearch-http/src/routes/mod.rs b/meilisearch-http/src/routes/mod.rs index 93b7e1391..e6b914437 100644 --- a/meilisearch-http/src/routes/mod.rs +++ b/meilisearch-http/src/routes/mod.rs @@ -83,9 +83,6 @@ pub fn load_routes(app: &mut tide::Server) { .post(|ctx| into_response(setting::update_distinct(ctx))) .delete(|ctx| into_response(setting::delete_distinct(ctx))); - app.at("/indexes/:index/settings/identifier") - .get(|ctx| into_response(setting::get_identifier(ctx))); - app.at("/indexes/:index/settings/searchable-attributes") .get(|ctx| into_response(setting::get_searchable(ctx))) .post(|ctx| into_response(setting::update_searchable(ctx))) diff --git a/meilisearch-http/src/routes/setting.rs b/meilisearch-http/src/routes/setting.rs index 81cd12a72..3402cac1e 100644 --- a/meilisearch-http/src/routes/setting.rs +++ b/meilisearch-http/src/routes/setting.rs @@ -255,19 +255,6 @@ pub async fn delete_distinct(ctx: Request) -> SResult { Ok(tide::Response::new(202).body_json(&response_body)?) } -pub async fn get_identifier(ctx: Request) -> SResult { - ctx.is_allowed(Private)?; - let index = ctx.index()?; - let db = &ctx.state().db; - let reader = db.main_read_txn()?; - - let schema = index.main.schema(&reader)?; - - let identifier = schema.map(|s| s.identifier().to_string()); - - Ok(tide::Response::new(200).body_json(&identifier).unwrap()) -} - pub async fn get_searchable(ctx: Request) -> SResult { ctx.is_allowed(Private)?; let index = ctx.index()?;