diff --git a/src/automessages.vue b/src/automessages.vue index 132e061..c4535d7 100644 --- a/src/automessages.vue +++ b/src/automessages.vue @@ -352,11 +352,26 @@ export default { methods: { deleteAutoMessage(uuid) { - axios.delete(`config-editor/auto-messages/${uuid}`, this.$root.axiosOptions) - .then(() => { - this.$bus.$emit(constants.NOTIFY_CHANGE_PENDING, true) + this.$bvModal.msgBoxConfirm('Do you really want to delete this message?', { + buttonSize: 'sm', + cancelTitle: 'NO', + centered: true, + okTitle: 'YES', + okVariant: 'danger', + size: 'sm', + title: 'Please Confirm', + }) + .then(val => { + if (!val) { + return + } + + return axios.delete(`config-editor/auto-messages/${uuid}`, this.$root.axiosOptions) + .then(() => { + this.$bus.$emit(constants.NOTIFY_CHANGE_PENDING, true) + }) + .catch(err => this.$bus.$emit(constants.NOTIFY_FETCH_ERROR, err)) }) - .catch(err => this.$bus.$emit(constants.NOTIFY_FETCH_ERROR, err)) }, editAutoMessage(msg) { diff --git a/src/rules.vue b/src/rules.vue index 9d53d31..503d970 100644 --- a/src/rules.vue +++ b/src/rules.vue @@ -657,11 +657,26 @@ export default { }, deleteRule(uuid) { - axios.delete(`config-editor/rules/${uuid}`, this.$root.axiosOptions) - .then(() => { - this.$bus.$emit(constants.NOTIFY_CHANGE_PENDING, true) + this.$bvModal.msgBoxConfirm('Do you really want to delete this rule?', { + buttonSize: 'sm', + cancelTitle: 'NO', + centered: true, + okTitle: 'YES', + okVariant: 'danger', + size: 'sm', + title: 'Please Confirm', + }) + .then(val => { + if (!val) { + return + } + + return axios.delete(`config-editor/rules/${uuid}`, this.$root.axiosOptions) + .then(() => { + this.$bus.$emit(constants.NOTIFY_CHANGE_PENDING, true) + }) + .catch(err => this.$bus.$emit(constants.NOTIFY_FETCH_ERROR, err)) }) - .catch(err => this.$bus.$emit(constants.NOTIFY_FETCH_ERROR, err)) }, editRule(msg) {