mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 15:18:11 +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),
|
|
});
|