mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-06 03:49:40 +00:00
Update chapter editor remove redirect on save or delete all #4650
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Run Component Tests / Run Component Tests (push) Has been cancelled
Build and Push Docker Image / build (push) Has been cancelled
Integration Test / build and test (push) Has been cancelled
Run Unit Tests / Run Unit Tests (push) Has been cancelled
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Run Component Tests / Run Component Tests (push) Has been cancelled
Build and Push Docker Image / build (push) Has been cancelled
Integration Test / build and test (push) Has been cancelled
Run Unit Tests / Run Unit Tests (push) Has been cancelled
This commit is contained in:
parent
4b840f9c97
commit
85d5531bc1
1 changed files with 14 additions and 10 deletions
|
|
@ -697,11 +697,7 @@ export default {
|
||||||
this.saving = false
|
this.saving = false
|
||||||
if (data.updated) {
|
if (data.updated) {
|
||||||
this.$toast.success(this.$strings.ToastChaptersUpdated)
|
this.$toast.success(this.$strings.ToastChaptersUpdated)
|
||||||
if (this.previousRoute) {
|
this.reloadLibraryItem()
|
||||||
this.$router.push(this.previousRoute)
|
|
||||||
} else {
|
|
||||||
this.$router.push(`/item/${this.libraryItem.id}`)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary)
|
this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary)
|
||||||
}
|
}
|
||||||
|
|
@ -874,11 +870,7 @@ export default {
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data.updated) {
|
if (data.updated) {
|
||||||
this.$toast.success(this.$strings.ToastChaptersRemoved)
|
this.$toast.success(this.$strings.ToastChaptersRemoved)
|
||||||
if (this.previousRoute) {
|
this.reloadLibraryItem()
|
||||||
this.$router.push(this.previousRoute)
|
|
||||||
} else {
|
|
||||||
this.$router.push(`/item/${this.libraryItem.id}`)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary)
|
this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary)
|
||||||
}
|
}
|
||||||
|
|
@ -983,6 +975,18 @@ export default {
|
||||||
}
|
}
|
||||||
this.libraryItem = libraryItem
|
this.libraryItem = libraryItem
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
reloadLibraryItem() {
|
||||||
|
this.$axios
|
||||||
|
.$get(`/api/items/${this.libraryItem.id}?expanded=1`)
|
||||||
|
.then((data) => {
|
||||||
|
this.libraryItem = data
|
||||||
|
this.initChapters()
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Failed to reload library item', error)
|
||||||
|
this.$toast.error(this.$strings.ToastFailedToLoadData)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue