mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-30 15:55:26 +02:00
Add:Notification edit/delete and UI updates #996
This commit is contained in:
parent
37a3fdb606
commit
8e8046541e
8 changed files with 179 additions and 60 deletions
|
@ -201,7 +201,28 @@ export default {
|
|||
this.submitUpdate()
|
||||
}
|
||||
},
|
||||
submitUpdate() {},
|
||||
submitUpdate() {
|
||||
this.processing = true
|
||||
|
||||
const payload = {
|
||||
...this.newNotification
|
||||
}
|
||||
console.log('Sending update notification', payload)
|
||||
this.$axios
|
||||
.$patch(`/api/notifications/${payload.id}`, payload)
|
||||
.then((updatedSettings) => {
|
||||
this.$emit('update', updatedSettings)
|
||||
this.$toast.success('Notification updated')
|
||||
this.show = false
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to update notification', error)
|
||||
this.$toast.error('Failed to update notification')
|
||||
})
|
||||
.finally(() => {
|
||||
this.processing = false
|
||||
})
|
||||
},
|
||||
submitCreate() {
|
||||
this.processing = true
|
||||
|
||||
|
@ -211,8 +232,10 @@ export default {
|
|||
console.log('Sending create notification', payload)
|
||||
this.$axios
|
||||
.$post('/api/notifications', payload)
|
||||
.then(() => {
|
||||
.then((updatedSettings) => {
|
||||
this.$emit('update', updatedSettings)
|
||||
this.$toast.success('Notification created')
|
||||
this.show = false
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to create notification', error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue