mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 23:28:11 +00:00
Warehouse
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { cargoService } from '@/services/cargoService';
|
||||
import { cargoService, type DeliverCargoPayload } from '@/services/cargoService';
|
||||
|
||||
export const cargoKeys = {
|
||||
all: ['cargoes'] as const,
|
||||
@@ -53,7 +53,8 @@ export function useLoadCargo() {
|
||||
export function useDeliverCargo() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: (id: string) => cargoService.deliver(id),
|
||||
mutationFn: ({ id, payload }: { id: string; payload?: DeliverCargoPayload }) =>
|
||||
cargoService.deliver(id, payload),
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: cargoKeys.all })
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user