Fix:Relative file path for single book scans, Change:Route names & refactor api

This commit is contained in:
advplyr 2021-11-21 20:00:40 -06:00
parent 2194d55cc0
commit 66a490365a
41 changed files with 1057 additions and 986 deletions

View file

@ -68,7 +68,7 @@ export default {
books: this.booksCopy.map((b) => b.id)
}
this.$axios
.$patch(`/api/collection/${this.collectionId}`, collectionUpdate)
.$patch(`/api/collections/${this.collectionId}`, collectionUpdate)
.then((collection) => {
console.log('Collection updated', collection)
})

View file

@ -101,7 +101,7 @@ export default {
if (confirm(`Are you sure you want to permanently delete user "${user.username}"?`)) {
this.isDeletingUser = true
this.$axios
.$delete(`/api/user/${user.id}`)
.$delete(`/api/users/${user.id}`)
.then((data) => {
this.isDeletingUser = false
if (data.error) {

View file

@ -140,7 +140,7 @@ export default {
}
this.isProcessingReadUpdate = true
this.$axios
.$patch(`/api/user/audiobook/${this.book.id}`, updatePayload)
.$patch(`/api/me/audiobook/${this.book.id}`, updatePayload)
.then(() => {
this.isProcessingReadUpdate = false
this.$toast.success(`"${this.bookTitle}" Marked as ${updatePayload.isRead ? 'Read' : 'Not Read'}`)
@ -155,7 +155,7 @@ export default {
this.processingRemove = true
this.$axios
.$delete(`/api/collection/${this.collectionId}/book/${this.book.id}`)
.$delete(`/api/collections/${this.collectionId}/book/${this.book.id}`)
.then((updatedCollection) => {
console.log(`Book removed from collection`, updatedCollection)
this.$toast.success('Book removed from collection')