Fix: Manually delete company cache #1214 (#1315)

* Fix: Manually delete company cache #1214

* Fix: Prettier error
This commit is contained in:
ABHISHEK PATEL
2023-08-25 15:20:26 -04:00
committed by GitHub
parent 209e8b64d9
commit 9027a7dd1e

View File

@ -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,
}),
});
});
},
});
}