Skip to content

Commit

Permalink
Fix copy collection API return code + client typing
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Jul 9, 2024
1 parent 2212742 commit 93c3cdd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 2 additions & 3 deletions client/src/api/datasetCollections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<string, never>> {
const { data } = await postCopyCollection({ id, dbkey });
return data;
export async function copyCollection(id: string, dbkey: string): Promise<void> {
await postCopyCollection({ id, dbkey });
}
6 changes: 2 additions & 4 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13782,10 +13782,8 @@ export interface operations {
};
responses: {
/** @description Successful Response */
200: {
content: {
"application/json": unknown;
};
204: {
content: never;
};
/** @description Validation Error */
422: {
Expand Down
4 changes: 4 additions & 0 deletions lib/galaxy/webapps/galaxy/api/dataset_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Body,
Path,
Query,
Response,
status,
)
from typing_extensions import Annotated

Expand Down Expand Up @@ -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,
Expand All @@ -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",
Expand Down

0 comments on commit 93c3cdd

Please sign in to comment.