mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
error when deleting unexisting index
This commit is contained in:
parent
32843e9ade
commit
11e00c906f
@ -311,9 +311,11 @@ async fn delete_index(
|
|||||||
data: web::Data<Data>,
|
data: web::Data<Data>,
|
||||||
path: web::Path<IndexParam>,
|
path: web::Path<IndexParam>,
|
||||||
) -> Result<HttpResponse, ResponseError> {
|
) -> Result<HttpResponse, ResponseError> {
|
||||||
data.db.delete_index(&path.index_uid)?;
|
if data.db.delete_index(&path.index_uid)? {
|
||||||
|
Ok(HttpResponse::NoContent().finish())
|
||||||
Ok(HttpResponse::NoContent().finish())
|
} else {
|
||||||
|
Err(Error::index_not_found(&path.index_uid).into())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
Loading…
Reference in New Issue
Block a user