fix(core-flows, dashboard): products category batch issue (#9766)

FIXES CC-624
This commit is contained in:
Frane Polić
2024-10-25 10:52:05 +02:00
committed by GitHub
parent d40499ca6a
commit 853dd38044
2 changed files with 8 additions and 2 deletions

View File

@@ -143,6 +143,10 @@ export const useUpdateProductCategoryProducts = (
queryKey: productsQueryKeys.lists(),
})
queryClient.invalidateQueries({
queryKey: productsQueryKeys.details(),
})
options?.onSuccess?.(data, variables, context)
},
...options,

View File

@@ -26,7 +26,8 @@ export const batchLinkProductsToCategoryStep = createStep(
const dbProducts = await service.listProducts(
{ 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(
{ id: prevData.productIds },
{
select: ["id", "categories"],
select: ["id"],
relations: ["categories"],
}
)