Minor improvments
This commit is contained in:
		@@ -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)?;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user