mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-27 14:18:35 +00:00
fix: images in child items (#623)
* support parentID search
* fetch images for item children
Former-commit-id: afbc6a49ac
This commit is contained in:
parent
a26ea3bac5
commit
798d873f76
4 changed files with 27 additions and 10 deletions
|
@ -22,6 +22,7 @@ export type ItemsQuery = {
|
|||
pageSize?: number;
|
||||
locations?: string[];
|
||||
labels?: string[];
|
||||
parentIds?: string[];
|
||||
q?: string;
|
||||
fields?: string[];
|
||||
};
|
||||
|
|
|
@ -404,6 +404,23 @@
|
|||
},
|
||||
];
|
||||
});
|
||||
|
||||
const items = computedAsync(async () => {
|
||||
if (!item.value) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const resp = await api.items.getAll({
|
||||
parentIds: [item.value.id],
|
||||
});
|
||||
|
||||
if (resp.error) {
|
||||
toast.error("Failed to load items");
|
||||
return [];
|
||||
}
|
||||
|
||||
return resp.data.items;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -565,8 +582,8 @@
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<section v-if="!hasNested && item.children.length > 0" class="my-6">
|
||||
<ItemViewSelectable :items="item.children" />
|
||||
<section v-if="items && items.length > 0" class="my-6">
|
||||
<ItemViewSelectable :items="items" />
|
||||
</section>
|
||||
</BaseContainer>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue