mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-11 03:41:42 +00:00
Update: collection add toast messages
This commit is contained in:
parent
5b7e56bba3
commit
acace5fc48
2 changed files with 7 additions and 5 deletions
|
|
@ -172,12 +172,12 @@ export default {
|
||||||
.$post(`/api/collections/${collection.id}/batch/add`, { books: this.selectedBookIds })
|
.$post(`/api/collections/${collection.id}/batch/add`, { books: this.selectedBookIds })
|
||||||
.then((updatedCollection) => {
|
.then((updatedCollection) => {
|
||||||
console.log(`Books added to collection`, updatedCollection)
|
console.log(`Books added to collection`, updatedCollection)
|
||||||
this.$toast.success('Books added to collection')
|
this.$toast.success(this.$strings.ToastCollectionItemsAddSuccess)
|
||||||
this.processing = false
|
this.processing = false
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Failed to add books to collection', error)
|
console.error('Failed to add books to collection', error)
|
||||||
this.$toast.error('Failed to add books to collection')
|
this.$toast.error(this.$strings.ToastCollectionItemsAddFailed)
|
||||||
this.processing = false
|
this.processing = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -187,12 +187,12 @@ export default {
|
||||||
.$post(`/api/collections/${collection.id}/book`, { id: this.selectedLibraryItemId })
|
.$post(`/api/collections/${collection.id}/book`, { id: this.selectedLibraryItemId })
|
||||||
.then((updatedCollection) => {
|
.then((updatedCollection) => {
|
||||||
console.log(`Book added to collection`, updatedCollection)
|
console.log(`Book added to collection`, updatedCollection)
|
||||||
this.$toast.success('Book added to collection')
|
this.$toast.success(this.$strings.ToastCollectionItemsAddSuccess)
|
||||||
this.processing = false
|
this.processing = false
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Failed to add book to collection', error)
|
console.error('Failed to add book to collection', error)
|
||||||
this.$toast.error('Failed to add book to collection')
|
this.$toast.error(this.$strings.ToastCollectionItemsAddFailed)
|
||||||
this.processing = false
|
this.processing = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -221,7 +221,7 @@ export default {
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Failed to create collection', error)
|
console.error('Failed to create collection', error)
|
||||||
var errMsg = error.response ? error.response.data || '' : ''
|
var errMsg = error.response ? error.response.data || '' : ''
|
||||||
this.$toast.error(`Failed to create collection: ${errMsg}`)
|
this.$toast.error(this.$strings.ToastCollectionCreateFailed + ': ' + errMsg)
|
||||||
this.processing = false
|
this.processing = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -834,6 +834,8 @@
|
||||||
"ToastCachePurgeSuccess": "Cache purged successfully",
|
"ToastCachePurgeSuccess": "Cache purged successfully",
|
||||||
"ToastChaptersHaveErrors": "Chapters have errors",
|
"ToastChaptersHaveErrors": "Chapters have errors",
|
||||||
"ToastChaptersMustHaveTitles": "Chapters must have titles",
|
"ToastChaptersMustHaveTitles": "Chapters must have titles",
|
||||||
|
"ToastCollectionItemsAddFailed": "Item(s) added to collection failed",
|
||||||
|
"ToastCollectionItemsAddSuccess": "Item(s) added to collection success",
|
||||||
"ToastCollectionItemsRemoveFailed": "Failed to remove item(s) from collection",
|
"ToastCollectionItemsRemoveFailed": "Failed to remove item(s) from collection",
|
||||||
"ToastCollectionItemsRemoveSuccess": "Item(s) removed from collection",
|
"ToastCollectionItemsRemoveSuccess": "Item(s) removed from collection",
|
||||||
"ToastCollectionRemoveFailed": "Failed to remove collection",
|
"ToastCollectionRemoveFailed": "Failed to remove collection",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue