(id: string)
| 157 | }); |
| 158 | |
| 159 | async function fetchScheduleById(id: string): Promise<WorkflowSchedule> { |
| 160 | const response = await apiClient.getSchedule(id); |
| 161 | if (response.error) { |
| 162 | throw new Error('Failed to fetch schedule'); |
| 163 | } |
| 164 | const schedule = (response.data ?? null) as WorkflowSchedule | null; |
| 165 | if (!schedule) { |
| 166 | throw new Error('Schedule not found'); |
| 167 | } |
| 168 | return schedule; |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * API Service |