Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

return 202 on settings update / reset #106

Merged
merged 2 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions meilisearch-http/src/routes/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async fn update_all(
.update_settings(index_uid.into_inner(), body.into_inner(), true)
.await
{
Ok(update_result) => Ok(HttpResponse::Ok().json(update_result)),
Ok(update_result) => Ok(HttpResponse::Accepted().json(update_result)),
Err(e) => {
Ok(HttpResponse::BadRequest().json(serde_json::json!({ "error": e.to_string() })))
}
Expand Down Expand Up @@ -161,7 +161,7 @@ async fn delete_all(
.update_settings(index_uid.into_inner(), settings, false)
.await
{
Ok(update_result) => Ok(HttpResponse::Ok().json(update_result)),
Ok(update_result) => Ok(HttpResponse::Accepted().json(update_result)),
Err(e) => {
Ok(HttpResponse::BadRequest().json(serde_json::json!({ "error": e.to_string() })))
}
Expand Down
4 changes: 3 additions & 1 deletion meilisearch-http/tests/settings/get_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ async fn update_setting_unexisting_index() {
let server = Server::new().await;
let index = server.index("test");
let (_response, code) = index.update_settings(json!({})).await;
assert_eq!(code, 200);
assert_eq!(code, 202);
let (_response, code) = index.get().await;
assert_eq!(code, 200);
let (_response, code) = index.delete_settings().await;
assert_eq!(code, 202);
}

#[actix_rt::test]
Expand Down