diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index 7e3cda1f61c4..c5efbb5b9de3 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -12397,6 +12397,26 @@ export interface components { visible?: boolean | null; [key: string]: unknown; }; + /** UpdateHistoryPayload */ + UpdateHistoryPayload: { + /** Annotation */ + annotation?: string | null; + /** Deleted */ + deleted?: boolean | null; + /** Genome Build */ + genome_build?: string | null; + /** Importable */ + importable?: boolean | null; + /** Name */ + name?: string | null; + /** Preferred Object Store Id */ + preferred_object_store_id?: string | null; + /** Published */ + published?: boolean | null; + /** Purged */ + purged?: boolean | null; + tags?: components["schemas"]["TagCollection"] | null; + }; /** UpdateInstancePayload */ UpdateInstancePayload: { /** Active */ @@ -17588,7 +17608,7 @@ export interface operations { }; requestBody: { content: { - "application/json": unknown; + "application/json": components["schemas"]["UpdateHistoryPayload"]; }; }; responses: { diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index e83c76edfef2..879d3158ad2f 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -1445,6 +1445,18 @@ class CustomHistoryView(HistoryDetailed): ] +class UpdateHistoryPayload(Model): + name: Optional[str] = None + annotation: Optional[str] = None + tags: Optional[TagCollection] = None + published: Optional[bool] = None + importable: Optional[bool] = None + deleted: Optional[bool] = None + purged: Optional[bool] = None + genome_build: Optional[str] = None + preferred_object_store_id: Optional[str] = None + + class ExportHistoryArchivePayload(Model): gzip: Optional[bool] = Field( default=True, diff --git a/lib/galaxy/webapps/galaxy/api/histories.py b/lib/galaxy/webapps/galaxy/api/histories.py index 067dd425369a..de0a331ec70f 100644 --- a/lib/galaxy/webapps/galaxy/api/histories.py +++ b/lib/galaxy/webapps/galaxy/api/histories.py @@ -57,6 +57,7 @@ ShareWithPayload, SharingStatus, StoreExportPayload, + UpdateHistoryPayload, WriteStoreToPayload, ) from galaxy.schema.types import LatestLiteral @@ -457,13 +458,14 @@ def update( self, history_id: HistoryIDPathParam, trans: ProvidesHistoryContext = DependsOnTrans, - payload: Any = Body( + payload: UpdateHistoryPayload = Body( ..., description="Object containing any of the editable fields of the history.", ), serialization_params: SerializationParams = Depends(query_serialization_params), ) -> AnyHistoryView: - return self.service.update(trans, history_id, payload, serialization_params) + data = payload.model_dump(exclude_unset=True) + return self.service.update(trans, history_id, data, serialization_params) @router.post( "/api/histories/from_store",