* Fetches schedule data for a specific workflow block
( workflowId: string, blockId: string, signal?: AbortSignal )
| 53 | * Fetches schedule data for a specific workflow block |
| 54 | */ |
| 55 | async function fetchSchedule( |
| 56 | workflowId: string, |
| 57 | blockId: string, |
| 58 | signal?: AbortSignal |
| 59 | ): Promise<ScheduleData | null> { |
| 60 | try { |
| 61 | const data = await requestJson(getScheduleContract, { |
| 62 | query: { workflowId, blockId }, |
| 63 | signal, |
| 64 | }) |
| 65 | return data.schedule || null |
| 66 | } catch (error) { |
| 67 | if (isApiClientError(error) && error.status === 404) return null |
| 68 | throw error |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Fetch all schedules for a workspace. |
no test coverage detected