fix: add status field to PersonInfo struct

This commit is contained in:
2026-06-15 04:10:40 +08:00
parent 0dfa80918f
commit fb47acf67b
2 changed files with 8 additions and 4 deletions

View File

@@ -24,10 +24,12 @@ struct FileInfo {
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct PersonInfo {
identity_uuid: String,
name: String,
starred: bool,
status: String,
}
#[derive(Serialize)]
@@ -148,6 +150,7 @@ async fn get_files(args: GetFilesArgs) -> Result<Vec<FileInfo>, String> {
#[tauri::command(rename_all = "camelCase")]
async fn get_people(_page: usize, _per_page: usize) -> Result<Vec<PersonInfo>, String> {
eprintln!("[get_people] called");
let client = reqwest::Client::new();
let mut all_people = Vec::new();
let mut page = 1;
@@ -167,6 +170,7 @@ async fn get_people(_page: usize, _per_page: usize) -> Result<Vec<PersonInfo>, S
identity_uuid: uuid.to_string(),
name: name.to_string(),
starred: i["metadata"]["starred"].as_bool().unwrap_or(false),
status: "confirmed".to_string(),
});
}
}

View File

@@ -164,11 +164,11 @@ onMounted(async () => {
console.log('PeopleView: calling getPeople...')
const result: any = await invoke('getPeople', { page: 1, perPage: 1000 })
console.log('PeopleView: getPeople result:', Array.isArray(result) ? result.length : typeof result)
people.value = (Array.isArray(result) ? result : []).map((p: any) => ({
...p,
status: p.status || 'confirmed'
}))
people.value = Array.isArray(result) ? result : []
console.log('PeopleView: people.value length:', people.value.length)
if (people.value.length > 0) {
console.log('PeopleView: first person:', JSON.stringify(people.value[0]))
}
} catch (e) {
console.error('Failed to load people:', e)
} finally {