fix: use byId() instead of detail() in QUERY_KEYS

QUERY_KEYS.FIRST_MILE and QUERY_KEYS.LAST_MILE have byId() not detail().

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
natib21
2026-06-30 04:04:56 +00:00
parent 0bc9534172
commit 360e61ac15
2 changed files with 2 additions and 2 deletions

View File

@@ -444,7 +444,7 @@ const FirstMilePage = () => {
mutationFn: (data) => api.post(`/first-mile/${containerAllocationFirstMileId}/allocate-containers`, data),
onSuccess: () => {
toast({ title: "Containers allocated" });
void qc.invalidateQueries({ queryKey: QUERY_KEYS.FIRST_MILE.detail(containerAllocationFirstMileId ?? "") });
void qc.invalidateQueries({ queryKey: QUERY_KEYS.FIRST_MILE.byId(containerAllocationFirstMileId ?? "") });
setContainerAllocationOpen(false);
setContainerAllocationFirstMileId(null);
},

View File

@@ -395,7 +395,7 @@ const LastMilePage = () => {
api.post(`/last-mile/${activeId}/allocate-containers`, data),
onSuccess: () => {
toast({ title: "Containers allocated", variant: "default" });
void qc.invalidateQueries({ queryKey: QUERY_KEYS.LAST_MILE.detail(activeId ?? "") });
void qc.invalidateQueries({ queryKey: QUERY_KEYS.LAST_MILE.byId(activeId ?? "") });
closeAllocation();
},
onError: () => {