Return empty value if nothing is found.
This commit is contained in:
parent
cd2b0558ad
commit
7d5852efdd
1 changed files with 1 additions and 12 deletions
13
src/main.rs
13
src/main.rs
|
@ -173,18 +173,7 @@ async fn get_progress(
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
if values.is_empty() {
|
if values.is_empty() {
|
||||||
let res = GetProgress {
|
return (StatusCode::OK, Json(json!({})));
|
||||||
percentage: 0.0f32,
|
|
||||||
progress: String::new(),
|
|
||||||
device: String::new(),
|
|
||||||
device_id: String::new(),
|
|
||||||
timestamp: 0,
|
|
||||||
document,
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
StatusCode::OK,
|
|
||||||
Json(json!({})),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = GetProgress {
|
let res = GetProgress {
|
||||||
|
|
Loading…
Reference in a new issue