mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 20:01:17 +00:00
[editor] [#23] Add confirmation for delete buttons
resolves #23 Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
e1a947494b
commit
05064b08b3
2 changed files with 38 additions and 8 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue