fix: send jobId/jobName instead of command when triggering cron jobs

The 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.
This commit is contained in:
Nyk 2026-03-02 02:44:20 +07:00
parent 1544d9f725
commit b6c6bb955d
2 changed files with 3 additions and 1 deletions

View File

@ -98,7 +98,8 @@ export function CronManagementPanel() {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
action: 'trigger',
command: job.command
jobId: job.id,
jobName: job.name,
})
})

View File

@ -31,6 +31,7 @@ export interface LogEntry {
}
export interface CronJob {
id?: string
name: string
schedule: string
command: string