Bugfix/Loader delete error (#3002)

fix loader delete error
This commit is contained in:
Henry Heng 2024-08-12 14:42:15 +01:00 committed by GitHub
parent 68769f4bbc
commit 3f1a10250f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -226,7 +226,7 @@ const DeleteDocStoreDialog = ({ show, dialogProps, onCancel, onDelete }) => {
<Button onClick={onCancel} color='primary'> <Button onClick={onCancel} color='primary'>
Cancel Cancel
</Button> </Button>
<Button variant='contained' onClick={() => onDelete(dialogProps.type, removeFromVS)} color='error'> <Button variant='contained' onClick={() => onDelete(dialogProps.type, dialogProps.file, removeFromVS)} color='error'>
Delete Delete
</Button> </Button>
</DialogActions> </DialogActions>

View File

@ -184,8 +184,9 @@ const DocumentStoreDetails = () => {
} }
} }
const onDocStoreDelete = async (type, removeFromVectorStore) => { const onDocStoreDelete = async (type, file, removeFromVectorStore) => {
setBackdropLoading(true) setBackdropLoading(true)
setShowDeleteDocStoreDialog(false)
if (type === 'STORE') { if (type === 'STORE') {
if (removeFromVectorStore) { if (removeFromVectorStore) {
await deleteVectorStoreDataFromStore(storeId) await deleteVectorStoreDataFromStore(storeId)
@ -272,7 +273,8 @@ const DocumentStoreDetails = () => {
description: `Delete Loader ${file.loaderName} ? This will delete all the associated document chunks.`, description: `Delete Loader ${file.loaderName} ? This will delete all the associated document chunks.`,
vectorStoreConfig, vectorStoreConfig,
recordManagerConfig, recordManagerConfig,
type: 'LOADER' type: 'LOADER',
file
} }
setDeleteDocStoreDialogProps(props) setDeleteDocStoreDialogProps(props)