delete index returns 204 instead of 200

This commit is contained in:
mpostma 2021-03-15 18:44:33 +01:00
parent 0c17b166df
commit 58fab035bb
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A
2 changed files with 2 additions and 2 deletions

View File

@ -115,7 +115,7 @@ async fn delete_index(
path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
match data.delete_index(path.index_uid.clone()).await {
Ok(_) => Ok(HttpResponse::Ok().finish()),
Ok(_) => Ok(HttpResponse::NoContent().finish()),
Err(e) => {
Ok(HttpResponse::BadRequest().body(serde_json::json!({ "error": e.to_string() })))
}

View File

@ -10,7 +10,7 @@ async fn create_and_delete_index() {
let (_response, code) = index.delete().await;
assert_eq!(code, 200);
assert_eq!(code, 204);
assert_eq!(index.get().await.1, 400);
}