From 55fcbf107d93b888efb55a99380eed2ad2f8555d Mon Sep 17 00:00:00 2001 From: Accusys Date: Sat, 26 Sep 2026 21:27:47 +0800 Subject: [PATCH] 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 --- src/api/identity_api.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/identity_api.rs b/src/api/identity_api.rs index 501e08fd..121a6126 100644 --- a/src/api/identity_api.rs +++ b/src/api/identity_api.rs @@ -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, }