mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 14:54:27 +01:00
delete index returns 204 instead of 200
This commit is contained in:
parent
0c17b166df
commit
58fab035bb
@ -115,7 +115,7 @@ async fn delete_index(
|
|||||||
path: web::Path<IndexParam>,
|
path: web::Path<IndexParam>,
|
||||||
) -> Result<HttpResponse, ResponseError> {
|
) -> Result<HttpResponse, ResponseError> {
|
||||||
match data.delete_index(path.index_uid.clone()).await {
|
match data.delete_index(path.index_uid.clone()).await {
|
||||||
Ok(_) => Ok(HttpResponse::Ok().finish()),
|
Ok(_) => Ok(HttpResponse::NoContent().finish()),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
Ok(HttpResponse::BadRequest().body(serde_json::json!({ "error": e.to_string() })))
|
Ok(HttpResponse::BadRequest().body(serde_json::json!({ "error": e.to_string() })))
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ async fn create_and_delete_index() {
|
|||||||
|
|
||||||
let (_response, code) = index.delete().await;
|
let (_response, code) = index.delete().await;
|
||||||
|
|
||||||
assert_eq!(code, 200);
|
assert_eq!(code, 204);
|
||||||
|
|
||||||
assert_eq!(index.get().await.1, 400);
|
assert_eq!(index.get().await.1, 400);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user