mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-18 08:48:32 +08:00
Update the http index deletion route
This commit is contained in:
parent
95eb6ad09a
commit
69832e8c70
@ -188,15 +188,19 @@ pub async fn get_all_updates_status(ctx: Context<Data>) -> SResult<Response> {
|
|||||||
|
|
||||||
pub async fn delete_index(ctx: Context<Data>) -> SResult<StatusCode> {
|
pub async fn delete_index(ctx: Context<Data>) -> SResult<StatusCode> {
|
||||||
ctx.is_allowed(IndexesWrite)?;
|
ctx.is_allowed(IndexesWrite)?;
|
||||||
let _index_name = ctx.url_param("index")?;
|
let index_name = ctx.url_param("index")?;
|
||||||
let _index = ctx.index()?;
|
|
||||||
|
|
||||||
// ctx.state()
|
let found = ctx
|
||||||
// .db
|
.state()
|
||||||
// .delete_index(&index_name)
|
.db
|
||||||
// .map_err(ResponseError::internal)?;
|
.delete_index(&index_name)
|
||||||
|
.map_err(ResponseError::internal)?;
|
||||||
|
|
||||||
Ok(StatusCode::NOT_IMPLEMENTED)
|
if found {
|
||||||
|
Ok(StatusCode::OK)
|
||||||
|
} else {
|
||||||
|
Ok(StatusCode::NOT_FOUND)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn index_update_callback(index_name: &str, data: &Data, _status: ProcessedUpdateResult) {
|
pub fn index_update_callback(index_name: &str, data: &Data, _status: ProcessedUpdateResult) {
|
||||||
|
Loading…
Reference in New Issue
Block a user