Spaces:
Runtime error
Runtime error
Nyk commited on
Commit ·
8649dcc
1
Parent(s): 8f6b4f4
fix: send jobId/jobName instead of command when triggering cron jobs
Browse filesThe triggerJob function was sending { command: job.command } to the API,
but the backend expects jobId or jobName to identify the job. This caused
all manual cron triggers to fail with "Job ID required" (400 error).
Also adds the missing `id` field to the CronJob store interface so
TypeScript recognizes the field already returned by the API.
src/components/panels/cron-management-panel.tsx
CHANGED
|
@@ -98,7 +98,8 @@ export function CronManagementPanel() {
|
|
| 98 |
headers: { 'Content-Type': 'application/json' },
|
| 99 |
body: JSON.stringify({
|
| 100 |
action: 'trigger',
|
| 101 |
-
|
|
|
|
| 102 |
})
|
| 103 |
})
|
| 104 |
|
|
|
|
| 98 |
headers: { 'Content-Type': 'application/json' },
|
| 99 |
body: JSON.stringify({
|
| 100 |
action: 'trigger',
|
| 101 |
+
jobId: job.id,
|
| 102 |
+
jobName: job.name,
|
| 103 |
})
|
| 104 |
})
|
| 105 |
|
src/store/index.ts
CHANGED
|
@@ -31,6 +31,7 @@ export interface LogEntry {
|
|
| 31 |
}
|
| 32 |
|
| 33 |
export interface CronJob {
|
|
|
|
| 34 |
name: string
|
| 35 |
schedule: string
|
| 36 |
command: string
|
|
|
|
| 31 |
}
|
| 32 |
|
| 33 |
export interface CronJob {
|
| 34 |
+
id?: string
|
| 35 |
name: string
|
| 36 |
schedule: string
|
| 37 |
command: string
|