diff --git a/front/src/modules/companies/hooks/useDeleteCompanies.ts b/front/src/modules/companies/hooks/useDeleteCompanies.ts index 67b21b220..56687fb89 100644 --- a/front/src/modules/companies/hooks/useDeleteCompanies.ts +++ b/front/src/modules/companies/hooks/useDeleteCompanies.ts @@ -33,10 +33,20 @@ export function useDeleteSelectedComapnies() { count: rowIdsToDelete.length, }, }, - update: () => { + update: (cache) => { setTableRowIds( tableRowIds.filter((id) => !rowIdsToDelete.includes(id)), ); + + // Manually update the cache to match the mutations + rowIdsToDelete.forEach((companyId) => { + cache.evict({ + id: cache.identify({ + __typename: 'Company', + id: companyId, + }), + }); + }); }, }); }