From 93c3cddab113938b0a3db69d94918aa1bbfb2375 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:05:57 +0200 Subject: [PATCH] Fix copy collection API return code + client typing --- client/src/api/datasetCollections.ts | 5 ++--- client/src/api/schema/schema.ts | 6 ++---- lib/galaxy/webapps/galaxy/api/dataset_collections.py | 4 ++++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/src/api/datasetCollections.ts b/client/src/api/datasetCollections.ts index cc45c5811cf7..2c6ee67c3c6a 100644 --- a/client/src/api/datasetCollections.ts +++ b/client/src/api/datasetCollections.ts @@ -72,7 +72,6 @@ export const fetchCollectionAttributes = fetcher .create(); const postCopyCollection = fetcher.path("/api/dataset_collections/{id}/copy").method("post").create(); -export async function copyCollection(id: string, dbkey: string): Promise> { - const { data } = await postCopyCollection({ id, dbkey }); - return data; +export async function copyCollection(id: string, dbkey: string): Promise { + await postCopyCollection({ id, dbkey }); } diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index ec4802a1cb72..87ab03ff8948 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -13782,10 +13782,8 @@ export interface operations { }; responses: { /** @description Successful Response */ - 200: { - content: { - "application/json": unknown; - }; + 204: { + content: never; }; /** @description Validation Error */ 422: { diff --git a/lib/galaxy/webapps/galaxy/api/dataset_collections.py b/lib/galaxy/webapps/galaxy/api/dataset_collections.py index 5ef027c3978c..cecabb6e3c17 100644 --- a/lib/galaxy/webapps/galaxy/api/dataset_collections.py +++ b/lib/galaxy/webapps/galaxy/api/dataset_collections.py @@ -5,6 +5,8 @@ Body, Path, Query, + Response, + status, ) from typing_extensions import Annotated @@ -68,6 +70,7 @@ def create( @router.post( "/api/dataset_collections/{id}/copy", summary="Copy the given collection datasets to a new collection using a new `dbkey` attribute.", + status_code=status.HTTP_204_NO_CONTENT, ) def copy( self, @@ -76,6 +79,7 @@ def copy( payload: UpdateCollectionAttributePayload = Body(...), ): self.service.copy(trans, id, payload) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get( "/api/dataset_collections/{id}/attributes",