type setting struct

This commit is contained in:
Marin Postma 2021-05-10 17:30:09 +02:00
parent 998d5ead34
commit 706643dfed
No known key found for this signature in database
GPG key ID: D5241F0C0C865F30
11 changed files with 47 additions and 29 deletions

View file

@ -1,6 +1,6 @@
use actix_web::{delete, get, post, web, HttpResponse};
use crate::error::ResponseError;
use crate::{error::ResponseError, index::Unchecked};
use crate::helpers::Authentication;
use crate::index::Settings;
use crate::Data;
@ -138,10 +138,11 @@ create_services!(
async fn update_all(
data: web::Data<Data>,
index_uid: web::Path<String>,
body: web::Json<Settings>,
body: web::Json<Settings<Unchecked>>,
) -> Result<HttpResponse, ResponseError> {
let settings = body.into_inner().check();
match data
.update_settings(index_uid.into_inner(), body.into_inner(), true)
.update_settings(index_uid.into_inner(), settings, true)
.await
{
Ok(update_result) => Ok(