1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-07 10:38:54 +08:00

use actions, add store tests

This commit is contained in:
lana-k
2025-01-05 22:30:12 +01:00
parent d6408bdd85
commit 87f9f9eb01
5 changed files with 102 additions and 41 deletions

View File

@@ -331,7 +331,7 @@ export default {
this.errorMsg = "Inquiry name can't be empty"
return
}
this.$store.commit('renameInquiry', {
this.$store.dispatch('renameInquiry', {
inquiryId: this.processedInquiryId,
newName: this.newName
})
@@ -341,7 +341,7 @@ export default {
},
duplicateInquiry (index) {
const newInquiry = storedInquiries.duplicateInquiry(this.showedInquiries[index])
this.$store.commit('addInquiry', newInquiry)
this.$store.dispatch('addInquiry', newInquiry)
},
showDeleteDialog (idsSet) {
this.deleteGroup = idsSet.size > 1
@@ -353,14 +353,14 @@ export default {
deleteInquiry () {
this.$modal.hide('delete')
if (!this.deleteGroup) {
this.$store.commit('deleteInquiries', new Set().add(this.processedInquiryId))
this.$store.dispatch('deleteInquiries', new Set().add(this.processedInquiryId))
// Clear checkbox
if (this.selectedInquiriesIds.has(this.processedInquiryId)) {
this.selectedInquiriesIds.delete(this.processedInquiryId)
}
} else {
this.$store.commit('deleteInquiries', this.selectedInquiriesIds)
this.$store.dispatch('deleteInquiries', this.selectedInquiriesIds)
// Clear checkboxes
this.selectedInquiriesIds.clear()