Mnovich/fix scheduler api (#2682)

This commit is contained in:
Max Novich
2025-05-27 12:07:55 -07:00
committed by GitHub
parent 725fd0ea1e
commit f3588bd54c
3 changed files with 3 additions and 24 deletions

View File

@@ -6,7 +6,7 @@ import MoreMenuLayout from '../more_menu/MoreMenuLayout';
import { Card } from '../ui/card';
import { Button } from '../ui/button';
import { TrashIcon } from '../icons/TrashIcon';
import Plus from '../ui/Plus';
import { Plus } from 'lucide-react';
import { CreateScheduleModal, NewSchedulePayload } from './CreateScheduleModal';
import ScheduleDetailView from './ScheduleDetailView';
import cronstrue from 'cronstrue';

View File

@@ -1,21 +0,0 @@
import React from 'react';
export default function Plus({ size }: { size: number }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
style={{ height: size, width: size }}
width={size}
height={size}
viewBox={`0 0 ${size} ${size}`}
fill="none"
>
<path
d="M9.75 14.25V9.75H14.25V8.25H9.75V3.75H8.25V8.25H3.75V9.75H8.25V14.25H9.75Z"
fill="black"
dark:fill="white"
fillOpacity="0.25"
/>
</svg>
);
}

View File

@@ -48,7 +48,7 @@ export async function createSchedule(request: {
cron: string;
}): Promise<ScheduledJob> {
try {
const response = await apiCreateSchedule<true>({ data: request });
const response = await apiCreateSchedule<true>({ body: request });
if (response && response.data) {
return response.data as ScheduledJob;
}
@@ -62,7 +62,7 @@ export async function createSchedule(request: {
export async function deleteSchedule(id: string): Promise<void> {
try {
await apiDeleteSchedule<true>({ path: { schedule_id: id } });
await apiDeleteSchedule<true>({ path: { id } });
} catch (error) {
console.error(`Error deleting schedule ${id}:`, error);
throw error;