Fix:Batch new collection #282

This commit is contained in:
advplyr 2022-01-03 07:59:24 -06:00
parent 55e253ac60
commit 5a32fba88e

View File

@ -102,6 +102,9 @@ export default {
}, },
selectedBookIds() { selectedBookIds() {
return this.$store.state.selectedAudiobooks || [] return this.$store.state.selectedAudiobooks || []
},
currentLibraryId() {
return this.$store.state.libraries.currentLibraryId
} }
}, },
methods: { methods: {
@ -186,9 +189,10 @@ export default {
var books = this.showBatchUserCollectionModal ? this.selectedBookIds : [this.selectedAudiobookId] var books = this.showBatchUserCollectionModal ? this.selectedBookIds : [this.selectedAudiobookId]
var newCollection = { var newCollection = {
books: books, books: books,
libraryId: this.selectedAudiobook.libraryId, libraryId: this.currentLibraryId,
name: this.newCollectionName name: this.newCollectionName
} }
this.$axios this.$axios
.$post('/api/collections', newCollection) .$post('/api/collections', newCollection)
.then((data) => { .then((data) => {