mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
error when deleting unexisting index
This commit is contained in:
parent
32843e9ade
commit
11e00c906f
1 changed files with 5 additions and 3 deletions
|
@ -311,9 +311,11 @@ async fn delete_index(
|
|||
data: web::Data<Data>,
|
||||
path: web::Path<IndexParam>,
|
||||
) -> Result<HttpResponse, ResponseError> {
|
||||
data.db.delete_index(&path.index_uid)?;
|
||||
|
||||
Ok(HttpResponse::NoContent().finish())
|
||||
if data.db.delete_index(&path.index_uid)? {
|
||||
Ok(HttpResponse::NoContent().finish())
|
||||
} else {
|
||||
Err(Error::index_not_found(&path.index_uid).into())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue