Skip to content

Commit

Permalink
Return 204 instead of null from new DELETE endpoints.
Browse files Browse the repository at this point in the history
Again thanks to David!
  • Loading branch information
jmchilton committed May 17, 2024
1 parent 1332d93 commit 9262bcb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
20 changes: 6 additions & 14 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export interface paths {
"/api/file_source_instances": {
/** Get a list of persisted file source instances defined by the requesting user. */
get: operations["file_sources__instances_index"];
/** Create a user-bound object store. */
/** Create a user-bound file source. */
post: operations["file_sources__create_instance"];
};
"/api/file_source_instances/{user_file_source_id}": {
Expand Down Expand Up @@ -2672,7 +2672,7 @@ export interface components {
* Documentation
* @description Documentation or extended description for this plugin.
*/
doc: string;
doc?: string | null;
/**
* ID
* @description The `FilesSource` plugin identifier
Expand Down Expand Up @@ -5302,7 +5302,7 @@ export interface components {
* Documentation
* @description Documentation or extended description for this plugin.
*/
doc: string;
doc?: string | null;
/**
* ID
* @description The `FilesSource` plugin identifier
Expand Down Expand Up @@ -14967,7 +14967,7 @@ export interface operations {
};
};
file_sources__create_instance: {
/** Create a user-bound object store. */
/** Create a user-bound file source. */
parameters?: {
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
header?: {
Expand Down Expand Up @@ -15070,11 +15070,7 @@ export interface operations {
};
responses: {
/** @description Successful Response */
200: {
content: {
"application/json": Record<string, never>;
};
};
204: never;
/** @description Validation Error */
422: {
content: {
Expand Down Expand Up @@ -20951,11 +20947,7 @@ export interface operations {
};
responses: {
/** @description Successful Response */
200: {
content: {
"application/json": Record<string, never>;
};
};
204: never;
/** @description Validation Error */
422: {
content: {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/FilesDialog/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function fileSourcePluginToItem(plugin: BrowsableFilesSourcePlugin): Sele
const result = {
id: plugin.id,
label: plugin.label,
details: plugin.doc,
details: plugin.doc || "",
isLeaf: false,
url: plugin.uri_root,
};
Expand Down
8 changes: 6 additions & 2 deletions lib/galaxy/webapps/galaxy/api/file_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from fastapi import (
Body,
Path,
Response,
status,
)

from galaxy.files.templates import FileSourceTemplateSummaries
Expand Down Expand Up @@ -48,7 +50,7 @@ def index_templates(

@router.post(
"/api/file_source_instances",
summary="Create a user-bound object store.",
summary="Create a user-bound file source.",
operation_id="file_sources__create_instance",
)
def create(
Expand Down Expand Up @@ -98,10 +100,12 @@ def update_instance(
"/api/file_source_instances/{user_file_source_id}",
summary="Purge user file source instance.",
operation_id="file_sources__instances_purge",
status_code=status.HTTP_204_NO_CONTENT,
)
def purge_instance(
self,
trans: ProvidesUserContext = DependsOnTrans,
user_file_source_id: str = UserFileSourceIdPathParam,
) -> None:
):
self.file_source_instances_manager.purge_instance(trans, user_file_source_id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
6 changes: 5 additions & 1 deletion lib/galaxy/webapps/galaxy/api/object_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
Body,
Path,
Query,
Response,
status,
)

from galaxy.exceptions import (
Expand Down Expand Up @@ -147,13 +149,15 @@ def update_instance(
"/api/object_store_instances/{user_object_store_id}",
summary="Purge user object store instance.",
operation_id="object_stores__instances_purge",
status_code=status.HTTP_204_NO_CONTENT,
)
def purge_instance(
self,
trans: ProvidesUserContext = DependsOnTrans,
user_object_store_id: str = UserObjectStoreIdPathParam,
) -> None:
):
self.object_store_instance_manager.purge_instance(trans, user_object_store_id)
return Response(status_code=status.HTTP_204_NO_CONTENT)

@router.get(
"/api/object_store_templates",
Expand Down

0 comments on commit 9262bcb

Please sign in to comment.