feat: add is_registered field to FileItem API
- Add is_registered field to FileItem struct - Set is_registered based on status != 'pending' - Fixes Library card display issue (frontend expects is_registered field) Related: FaceNet CoreML integration testing completed successfully
This commit is contained in:
@@ -109,11 +109,14 @@ async fn list_files(
|
||||
.await
|
||||
.unwrap_or(0);
|
||||
|
||||
let is_registered = v.status.as_str() != "pending";
|
||||
|
||||
vec![FileItem {
|
||||
file_uuid: v.file_uuid,
|
||||
file_name: v.file_name,
|
||||
file_path: v.file_path,
|
||||
status: v.status.as_str().to_string(),
|
||||
is_registered,
|
||||
total_chunks: chunk_count,
|
||||
}]
|
||||
} else {
|
||||
@@ -148,6 +151,7 @@ async fn list_files(
|
||||
file_name: r.file_name,
|
||||
file_path: r.file_path,
|
||||
status: r.status.as_str().to_string(),
|
||||
is_registered: r.status.as_str() != "pending",
|
||||
total_chunks: 0,
|
||||
})
|
||||
.collect();
|
||||
@@ -201,6 +205,7 @@ pub struct FileItem {
|
||||
pub file_name: String,
|
||||
pub file_path: String,
|
||||
pub status: String,
|
||||
pub is_registered: bool,
|
||||
#[serde(default)]
|
||||
pub total_chunks: i64,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user