Minor improvments

This commit is contained in:
2024-10-08 22:24:00 +02:00
parent eafa8e6a4b
commit 138dd6c6b8
2 changed files with 6 additions and 6 deletions

View File

@ -57,7 +57,7 @@ pub async fn upload_firmware(
/// Download a firmware update
pub async fn download_firmware(path: web::Path<SpecificOTAVersionPath>) -> HttpResult {
if !ota_manager::update_exists(path.platform, &path.version)? {
return Ok(HttpResponse::NotFound().json("The requested firmware was not found!"));
return Ok(HttpResponse::NotFound().json("The requested firmware update was not found!"));
}
let firmware = ota_manager::get_ota_update(path.platform, &path.version)?;
@ -77,7 +77,7 @@ pub async fn download_firmware(path: web::Path<SpecificOTAVersionPath>) -> HttpR
/// Delete an uploaded firmware update
pub async fn delete_update(path: web::Path<SpecificOTAVersionPath>) -> HttpResult {
if !ota_manager::update_exists(path.platform, &path.version)? {
return Ok(HttpResponse::NotFound().json("The requested update was not found!"));
return Ok(HttpResponse::NotFound().json("The requested firmware update was not found!"));
}
ota_manager::delete_update(path.platform, &path.version)?;