Can delete an OTA update
This commit is contained in:
@ -74,6 +74,17 @@ pub async fn download_firmware(path: web::Path<SpecificOTAVersionPath>) -> HttpR
|
||||
.body(firmware))
|
||||
}
|
||||
|
||||
/// 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!"));
|
||||
}
|
||||
|
||||
ota_manager::delete_update(path.platform, &path.version)?;
|
||||
|
||||
Ok(HttpResponse::Accepted().finish())
|
||||
}
|
||||
|
||||
/// Get the list of all OTA updates
|
||||
pub async fn list_all_ota() -> HttpResult {
|
||||
Ok(HttpResponse::Ok().json(ota_manager::get_all_ota_updates()?))
|
||||
|
Reference in New Issue
Block a user