mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 05:25:41 +00:00
17 lines
403 B
TypeScript
17 lines
403 B
TypeScript
import { useQuery } from '@tanstack/react-query';
|
|
|
|
import { schedulesService } from '../services/schedules.service';
|
|
|
|
export const useSchedules = () =>
|
|
useQuery({
|
|
queryKey: ['schedules'],
|
|
queryFn: schedulesService.list,
|
|
});
|
|
|
|
export const useSchedule = (id: string) =>
|
|
useQuery({
|
|
queryKey: ['schedules', id],
|
|
queryFn: () => schedulesService.get(id),
|
|
enabled: Boolean(id),
|
|
});
|