Mnovich/fix scheduler api (#2682)
This commit is contained in:
@@ -6,7 +6,7 @@ import MoreMenuLayout from '../more_menu/MoreMenuLayout';
|
|||||||
import { Card } from '../ui/card';
|
import { Card } from '../ui/card';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
import { TrashIcon } from '../icons/TrashIcon';
|
import { TrashIcon } from '../icons/TrashIcon';
|
||||||
import Plus from '../ui/Plus';
|
import { Plus } from 'lucide-react';
|
||||||
import { CreateScheduleModal, NewSchedulePayload } from './CreateScheduleModal';
|
import { CreateScheduleModal, NewSchedulePayload } from './CreateScheduleModal';
|
||||||
import ScheduleDetailView from './ScheduleDetailView';
|
import ScheduleDetailView from './ScheduleDetailView';
|
||||||
import cronstrue from 'cronstrue';
|
import cronstrue from 'cronstrue';
|
||||||
|
|||||||
@@ -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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -48,7 +48,7 @@ export async function createSchedule(request: {
|
|||||||
cron: string;
|
cron: string;
|
||||||
}): Promise<ScheduledJob> {
|
}): Promise<ScheduledJob> {
|
||||||
try {
|
try {
|
||||||
const response = await apiCreateSchedule<true>({ data: request });
|
const response = await apiCreateSchedule<true>({ body: request });
|
||||||
if (response && response.data) {
|
if (response && response.data) {
|
||||||
return response.data as ScheduledJob;
|
return response.data as ScheduledJob;
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ export async function createSchedule(request: {
|
|||||||
|
|
||||||
export async function deleteSchedule(id: string): Promise<void> {
|
export async function deleteSchedule(id: string): Promise<void> {
|
||||||
try {
|
try {
|
||||||
await apiDeleteSchedule<true>({ path: { schedule_id: id } });
|
await apiDeleteSchedule<true>({ path: { id } });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error deleting schedule ${id}:`, error);
|
console.error(`Error deleting schedule ${id}:`, error);
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
Reference in New Issue
Block a user