fix(core-flows, dashboard): products category batch issue (#9766)
FIXES CC-624
This commit is contained in:
@@ -143,6 +143,10 @@ export const useUpdateProductCategoryProducts = (
|
|||||||
queryKey: productsQueryKeys.lists(),
|
queryKey: productsQueryKeys.lists(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: productsQueryKeys.details(),
|
||||||
|
})
|
||||||
|
|
||||||
options?.onSuccess?.(data, variables, context)
|
options?.onSuccess?.(data, variables, context)
|
||||||
},
|
},
|
||||||
...options,
|
...options,
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ export const batchLinkProductsToCategoryStep = createStep(
|
|||||||
const dbProducts = await service.listProducts(
|
const dbProducts = await service.listProducts(
|
||||||
{ id: [...(data.add ?? []), ...(data.remove ?? [])] },
|
{ id: [...(data.add ?? []), ...(data.remove ?? [])] },
|
||||||
{
|
{
|
||||||
select: ["id", "categories"],
|
select: ["id"],
|
||||||
|
relations: ["categories"],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -65,7 +66,8 @@ export const batchLinkProductsToCategoryStep = createStep(
|
|||||||
const dbProducts = await service.listProducts(
|
const dbProducts = await service.listProducts(
|
||||||
{ id: prevData.productIds },
|
{ id: prevData.productIds },
|
||||||
{
|
{
|
||||||
select: ["id", "categories"],
|
select: ["id"],
|
||||||
|
relations: ["categories"],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user