diff --git a/meilisearch-http/src/routes/index.rs b/meilisearch-http/src/routes/index.rs index 3df71cc76..bf37e2a28 100644 --- a/meilisearch-http/src/routes/index.rs +++ b/meilisearch-http/src/routes/index.rs @@ -390,19 +390,10 @@ pub async fn get_all_updates_status(ctx: Context) -> SResult { pub async fn delete_index(ctx: Context) -> SResult { ctx.is_allowed(IndexesWrite)?; + let _ = ctx.index()?; let index_uid = ctx.url_param("index")?; - - let found = ctx - .state() - .db - .delete_index(&index_uid) - .map_err(ResponseError::internal)?; - - if found { - Ok(StatusCode::NO_CONTENT) - } else { - Ok(StatusCode::NOT_FOUND) - } + ctx.state().db.delete_index(&index_uid).map_err(ResponseError::internal)?; + Ok(StatusCode::NO_CONTENT) } pub fn index_update_callback(index_uid: &str, data: &Data, status: ProcessedUpdateResult) {