mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 03:55:07 +08:00
update the settings routes
This commit is contained in:
parent
96cffeab1e
commit
79c63049d7
@ -43,6 +43,9 @@ pub struct Settings {
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub ranking_rules: Option<Option<Vec<String>>>,
|
||||
|
||||
// TODO we are missing the stopWords, synonyms and distinctAttribute for the GET settings
|
||||
// request
|
||||
}
|
||||
|
||||
impl Settings {
|
||||
|
@ -131,7 +131,9 @@ async fn update_all(
|
||||
.update_settings(index_uid.into_inner(), body.into_inner(), true)
|
||||
.await
|
||||
{
|
||||
Ok(update_result) => Ok(HttpResponse::Accepted().json(update_result)),
|
||||
Ok(update_result) => {
|
||||
Ok(HttpResponse::Accepted().json(serde_json::json!({ "updateId": update_result.id() })))
|
||||
}
|
||||
Err(e) => {
|
||||
Ok(HttpResponse::BadRequest().json(serde_json::json!({ "error": e.to_string() })))
|
||||
}
|
||||
@ -161,7 +163,9 @@ async fn delete_all(
|
||||
.update_settings(index_uid.into_inner(), settings, false)
|
||||
.await
|
||||
{
|
||||
Ok(update_result) => Ok(HttpResponse::Accepted().json(update_result)),
|
||||
Ok(update_result) => {
|
||||
Ok(HttpResponse::Accepted().json(serde_json::json!({ "updateId": update_result.id() })))
|
||||
}
|
||||
Err(e) => {
|
||||
Ok(HttpResponse::BadRequest().json(serde_json::json!({ "error": e.to_string() })))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user