feat: add useProcessorSnapshotById hook for snapshot-by-processorId endpoint
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -114,3 +114,25 @@ export function useProcessorSnapshot(
|
|||||||
enabled: !!executionId && index !== null,
|
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user