mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 00:38:11 +00:00
17 lines
395 B
TypeScript
17 lines
395 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
|
|
import { bookingsService } from "../services/bookings.service";
|
|
|
|
export const useBookings = () =>
|
|
useQuery({
|
|
queryKey: ["bookings"],
|
|
queryFn: bookingsService.list,
|
|
});
|
|
|
|
export const useBooking = (id: string) =>
|
|
useQuery({
|
|
queryKey: ["bookings", id],
|
|
queryFn: () => bookingsService.get(id),
|
|
enabled: Boolean(id),
|
|
});
|