diff --git a/src/api/identity_api.rs b/src/api/identity_api.rs index a9a26e05..42b0fa5e 100644 --- a/src/api/identity_api.rs +++ b/src/api/identity_api.rs @@ -119,6 +119,8 @@ async fn list_files( status: v.status.as_str().to_string(), is_registered, total_chunks: chunk_count, + file_size: None, + modified_time: None, }] } else { vec![] @@ -157,6 +159,8 @@ async fn list_files( status: "unregistered".to_string(), is_registered: false, total_chunks: 0, + file_size: Some(mb_file.size), + modified_time: Some(mb_file.modified), }); } @@ -196,6 +200,8 @@ async fn list_files( status: status.clone(), is_registered: status != "pending", total_chunks: 0, + file_size: None, + modified_time: None, }); } } @@ -275,6 +281,10 @@ pub struct FileItem { pub is_registered: bool, #[serde(default)] pub total_chunks: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub modified_time: Option, } #[derive(Debug, Serialize)]