feat: support bulk select and delete for documents (#13907)

This commit is contained in:
Sivin Varghese
2026-03-26 19:48:12 +05:30
committed by GitHub
parent 4c4b70da25
commit 4517c50227
10 changed files with 224 additions and 18 deletions

View File

@@ -25,17 +25,26 @@ export default createStore({
}
},
handleBulkDelete: async function handleBulkDelete({ dispatch }, ids) {
handleBulkDelete: async function handleBulkDelete(
{ dispatch },
{ type = 'AssistantResponse', ids }
) {
const response = await dispatch('processBulkAction', {
type: 'AssistantResponse',
type,
actionType: 'delete',
ids,
});
// Update the response store after successful API call
await dispatch('captainResponses/removeBulkResponses', ids, {
root: true,
});
if (type === 'AssistantResponse') {
// Update the response store after successful API call
await dispatch('captainResponses/removeBulkResponses', ids, {
root: true,
});
} else if (type === 'AssistantDocument') {
await dispatch('captainDocuments/removeBulkRecords', ids, {
root: true,
});
}
return response;
},