mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01: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> {
|
||||
ctx.is_allowed(IndexesWrite)?;
|
||||
let _index_name = ctx.url_param("index")?;
|
||||
let _index = ctx.index()?;
|
||||
let index_name = ctx.url_param("index")?;
|
||||
|
||||
// ctx.state()
|
||||
// .db
|
||||
// .delete_index(&index_name)
|
||||
// .map_err(ResponseError::internal)?;
|
||||
let found = ctx
|
||||
.state()
|
||||
.db
|
||||
.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) {
|
||||
|
Loading…
Reference in New Issue
Block a user