From 3af1d1f3b61dffc71fb2129189d238eec78327d0 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Fri, 27 Mar 2026 18:54:01 +0100 Subject: [PATCH] feat: add useProcessorSnapshotById hook for snapshot-by-processorId endpoint Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/src/api/queries/executions.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ui/src/api/queries/executions.ts b/ui/src/api/queries/executions.ts index 90a2e44b..681ea312 100644 --- a/ui/src/api/queries/executions.ts +++ b/ui/src/api/queries/executions.ts @@ -114,3 +114,25 @@ export function useProcessorSnapshot( enabled: !!executionId && index !== null, }); } + +export function useProcessorSnapshotById( + executionId: string | null, + processorId: string | null, +) { + return useQuery({ + queryKey: ['executions', 'snapshot-by-id', executionId, processorId], + queryFn: async () => { + const { data, error } = await api.GET( + '/executions/{executionId}/processors/by-id/{processorId}/snapshot', + { + params: { + path: { executionId: executionId!, processorId: processorId! }, + }, + }, + ); + if (error) throw new Error('Failed to load snapshot'); + return data!; + }, + enabled: !!executionId && !!processorId, + }); +}