mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
Add fetchCollectionAttributes to services
This commit is contained in:
@@ -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<DatasetCollectionAttributes> {
|
||||
const { data } = await getCollectionAttributes({ id: params.hdcaId, instance_type: "history" });
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user