diff --git a/client/src/stores/services/datasetCollection.service.ts b/client/src/stores/services/datasetCollection.service.ts index 5eca0c4f861..c52aabfc335 100644 --- a/client/src/stores/services/datasetCollection.service.ts +++ b/client/src/stores/services/datasetCollection.service.ts @@ -1,6 +1,6 @@ import { fetcher } from "@/schema"; -import { CollectionEntry, DCESummary, HDCADetailed, isHDCA } from "."; +import { CollectionEntry, DatasetCollectionAttributes, DCESummary, HDCADetailed, isHDCA } from "."; const DEFAULT_LIMIT = 50; @@ -53,3 +53,10 @@ export async function fetchElementsFromCollection(params: { limit: params.limit ?? DEFAULT_LIMIT, }); } + +const getCollectionAttributes = fetcher.path("/api/dataset_collections/{id}/attributes").method("get").create(); + +export async function fetchCollectionAttributes(params: { hdcaId: string }): Promise { + const { data } = await getCollectionAttributes({ id: params.hdcaId, instance_type: "history" }); + return data; +} diff --git a/client/src/stores/services/index.ts b/client/src/stores/services/index.ts index 2efb3132897..5cea4cd8e8d 100644 --- a/client/src/stores/services/index.ts +++ b/client/src/stores/services/index.ts @@ -58,6 +58,8 @@ export type HDCADetailed = components["schemas"]["HDCADetailed"]; */ export type DCObject = components["schemas"]["DCObject"]; +export type DatasetCollectionAttributes = components["schemas"]["DatasetCollectionAttributesResult"]; + /** * A SubCollection is a DatasetCollectionElement of type `dataset_collection` * with additional information to simplify its handling.