Skip to content

Commit 8d4bdc4

Browse files
committed
Add optional source parameter to copy content handler
1 parent 4db12a1 commit 8d4bdc4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

client/src/api/datasets.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,13 @@ type CopyContentBodyType = components["schemas"]["CreateHistoryContentPayload"];
7575
export async function copyContent(
7676
contentId: CopyContentBodyType["content"],
7777
historyId: CopyContentParamsType["path"]["history_id"],
78-
type: CopyContentParamsType["path"]["type"] = "dataset"
78+
type: CopyContentParamsType["path"]["type"] = "dataset",
79+
source: CopyContentBodyType["source"] = null
7980
) {
80-
const source = type === "dataset" ? "hda" : "hdca";
81+
// match source from type unless explicitly provided
82+
if (source === null) {
83+
source = type === "dataset" ? "hda" : "hdca";
84+
}
8185
const { data, error } = await GalaxyApi().POST("/api/histories/{history_id}/contents/{type}s", {
8286
params: {
8387
path: { history_id: historyId, type },

0 commit comments

Comments
 (0)