|
@@ -121,7 +121,13 @@ const Collections = () => {
|
|
|
const handleLoad = async (data: CollectionView) => {};
|
|
|
|
|
|
const handleDelete = async () => {
|
|
|
- console.log('selected', selectedCollections);
|
|
|
+ for (const item of selectedCollections) {
|
|
|
+ await CollectionHttp.deleteCollection(item._name);
|
|
|
+ }
|
|
|
+ openSnackBar(successTrans('delete', { name: t('collection') }));
|
|
|
+ fetchData();
|
|
|
+ handleCloseDialog();
|
|
|
+ setSelectedCollections([]);
|
|
|
};
|
|
|
|
|
|
const toolbarConfigs: ToolBarConfig[] = [
|
|
@@ -160,6 +166,7 @@ const Collections = () => {
|
|
|
},
|
|
|
label: t('delete'),
|
|
|
icon: 'delete',
|
|
|
+ disabled: data => data.length === 0,
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -252,7 +259,7 @@ const Collections = () => {
|
|
|
colDefinitions={colDefinitions}
|
|
|
rows={collectionList}
|
|
|
rowCount={total}
|
|
|
- primaryKey="id"
|
|
|
+ primaryKey="_name"
|
|
|
openCheckBox={true}
|
|
|
showHoverStyle={true}
|
|
|
selected={selectedCollections}
|