Files
edr-platform/apps/edr-freight-web/portal/src/hooks/useConsignments.ts
Michael Abebe 1c5ee19388 chore: fmt
2026-05-12 16:50:18 +03:00

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),
});