diff --git a/client/src/components/History/CurrentCollection/CollectionPanel.vue b/client/src/components/History/CurrentCollection/CollectionPanel.vue index 42e159a4039b..9a48db2afdd6 100644 --- a/client/src/components/History/CurrentCollection/CollectionPanel.vue +++ b/client/src/components/History/CurrentCollection/CollectionPanel.vue @@ -7,7 +7,7 @@ import ExpandedItems from "@/components/History/Content/ExpandedItems"; import { updateContentFields } from "@/components/History/model/queries"; import { useCollectionElementsStore } from "@/stores/collectionElementsStore"; import { HistorySummary } from "@/stores/historyStore"; -import { DCESummary, HDCASummary } from "@/stores/services"; +import { DCESummary, DCObject, HDCASummary } from "@/stores/services"; import CollectionDetails from "./CollectionDetails.vue"; import CollectionNavigation from "./CollectionNavigation.vue"; @@ -59,19 +59,9 @@ function onScroll(newOffset: number) { offset.value = newOffset; } -/** - * Passes a sub-collection i.e a collection element object containing another collection, into - * a populated object for drill-down without the need for a separate data request. This object - * is used for breadcrumbs in the navigation component and to render the collection details and - * description at the top of the collection panel. Details include the collection name, the - * collection type, and the element count. - */ -function onViewSubCollection(itemObject: HDCASummary, elementIdentifier: string) { - const collectionObject = { - name: elementIdentifier, - ...itemObject, - }; - emit("view-collection", collectionObject); +async function onViewSubCollection(itemObject: DCObject) { + const collection = await collectionElementsStore.getCollection(itemObject.id); + emit("view-collection", collection); } watch( diff --git a/client/src/stores/services/index.ts b/client/src/stores/services/index.ts index 49d8cc27d665..5c4053cbf0dd 100644 --- a/client/src/stores/services/index.ts +++ b/client/src/stores/services/index.ts @@ -5,6 +5,7 @@ export type DatasetDetails = components["schemas"]["HDADetailed"]; export type DCESummary = components["schemas"]["DCESummary"]; export type HDCASummary = components["schemas"]["HDCASummary"]; export type HDCADetailed = components["schemas"]["HDCADetailed"]; +export type DCObject = components["schemas"]["DCObject"]; export type HistoryContentItemBase = components["schemas"]["EncodedHistoryContentItem"];