* Fix: Manually delete company cache #1214 * Fix: Prettier error
This commit is contained in:
@ -33,10 +33,20 @@ export function useDeleteSelectedComapnies() {
|
|||||||
count: rowIdsToDelete.length,
|
count: rowIdsToDelete.length,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
update: () => {
|
update: (cache) => {
|
||||||
setTableRowIds(
|
setTableRowIds(
|
||||||
tableRowIds.filter((id) => !rowIdsToDelete.includes(id)),
|
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,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user