feat(items_list): populate new item cells with related property values based on their wikidata_id
This commit is contained in:
parent
765227e7aa
commit
1f81eae135
1 changed files with 9 additions and 0 deletions
|
@ -308,6 +308,15 @@ pub fn ItemsList(
|
|||
spawn_local(async move {
|
||||
let properties = fetch_item_properties(&wikidata_id, set_fetched_properties.clone()).await;
|
||||
log!("Fetched properties for Wikidata ID {}: {:?}", wikidata_id, properties);
|
||||
|
||||
// Populate the custom properties for the new item
|
||||
set_items.update(|items| {
|
||||
if let Some(item) = items.iter_mut().find(|item| item.wikidata_id.as_ref() == Some(&wikidata_id)) {
|
||||
for (property, value) in properties {
|
||||
item.custom_properties.insert(property, value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Hide the suggestion list
|
||||
|
|
Loading…
Add table
Reference in a new issue