Can delete uploaded disk images
This commit is contained in:
@ -132,12 +132,12 @@ pub async fn get_list() -> HttpResult {
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct DownloadFilePath {
|
||||
pub struct IsoFilePath {
|
||||
filename: String,
|
||||
}
|
||||
|
||||
/// Download ISO file
|
||||
pub async fn download_file(p: web::Path<DownloadFilePath>, req: HttpRequest) -> HttpResult {
|
||||
pub async fn download_file(p: web::Path<IsoFilePath>, req: HttpRequest) -> HttpResult {
|
||||
if !files_utils::check_file_name(&p.filename) {
|
||||
return Ok(HttpResponse::BadRequest().json("Invalid file name!"));
|
||||
}
|
||||
@ -152,7 +152,7 @@ pub async fn download_file(p: web::Path<DownloadFilePath>, req: HttpRequest) ->
|
||||
}
|
||||
|
||||
/// Delete ISO file
|
||||
pub async fn delete_file(p: web::Path<DownloadFilePath>) -> HttpResult {
|
||||
pub async fn delete_file(p: web::Path<IsoFilePath>) -> HttpResult {
|
||||
if !files_utils::check_file_name(&p.filename) {
|
||||
return Ok(HttpResponse::BadRequest().json("Invalid file name!"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user