From 58fab035bbddfd091989ed8cfdb12d384f525e12 Mon Sep 17 00:00:00 2001 From: mpostma Date: Mon, 15 Mar 2021 18:44:33 +0100 Subject: [PATCH] delete index returns 204 instead of 200 --- meilisearch-http/src/routes/index.rs | 2 +- meilisearch-http/tests/index/delete_index.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meilisearch-http/src/routes/index.rs b/meilisearch-http/src/routes/index.rs index c7c9e521a..29ba3d0d8 100644 --- a/meilisearch-http/src/routes/index.rs +++ b/meilisearch-http/src/routes/index.rs @@ -115,7 +115,7 @@ async fn delete_index( path: web::Path, ) -> Result { match data.delete_index(path.index_uid.clone()).await { - Ok(_) => Ok(HttpResponse::Ok().finish()), + Ok(_) => Ok(HttpResponse::NoContent().finish()), Err(e) => { Ok(HttpResponse::BadRequest().body(serde_json::json!({ "error": e.to_string() }))) } diff --git a/meilisearch-http/tests/index/delete_index.rs b/meilisearch-http/tests/index/delete_index.rs index 39e79daaf..0d1a7c820 100644 --- a/meilisearch-http/tests/index/delete_index.rs +++ b/meilisearch-http/tests/index/delete_index.rs @@ -10,7 +10,7 @@ async fn create_and_delete_index() { let (_response, code) = index.delete().await; - assert_eq!(code, 200); + assert_eq!(code, 204); assert_eq!(index.get().await.1, 400); }