This commit is contained in:
Martin Brodbeck 2023-09-26 20:43:20 +02:00
parent 1b1f0f7e68
commit 0848e5bd5d

View file

@ -167,12 +167,13 @@ async fn get_progress(
doc_key,
&["percentage", "progress", "device", "device_id", "timestamp"],
)
.unwrap();
.unwrap_or_default();
if values.is_empty() {
println!("nicht gefunden");
return (
StatusCode::FORBIDDEN,
Json(json!(r#""message": "Field 'document' not provided."#)),
Json(json!({"message": "Field 'document' not provided."})),
);
}
@ -189,5 +190,5 @@ async fn get_progress(
}
async fn healthcheck() -> (StatusCode, Json<Value>) {
(StatusCode::OK, Json(json!("{ \"state\" : \"OK\" }")))
(StatusCode::OK, Json(json!({ "state" : "OK" })))
}