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