fix: remove instance from cache after deleting

This commit is contained in:
jialin
2025-12-22 16:19:47 +08:00
parent d844cdadb5
commit 7e25b64689
14 changed files with 159 additions and 88 deletions
+8
View File
@@ -331,6 +331,13 @@ const Models: React.FC = () => {
});
};
const handleDeleteInstanceFromCache = (id: number) => {
cacheInsDataListRef.current = cacheInsDataListRef.current.filter(
(item) => item.id !== id
);
setModelInstances(cacheInsDataListRef.current);
};
useEffect(() => {
let timer: any = null;
// fetch data first time
@@ -436,6 +443,7 @@ const Models: React.FC = () => {
onStop={handleSearchBySilent}
onStart={handleSearchBySilent}
onTableSort={handleOnSortChange}
onDeleteInstanceFromCache={handleDeleteInstanceFromCache}
sortOrder={sortOrder}
queryParams={queryParams}
loading={dataSource.loading}