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

@ -150,7 +150,7 @@ export default {
if (confirm('WARNING! This action will remove all audiobooks from the database including any updates or matches you have made. This does not do anything to your actual files. Shall we continue?')) {
this.isResettingAudiobooks = true
this.$axios
.$delete('/api/audiobooks')
.$delete('/api/books/all')
.then(() => {
this.isResettingAudiobooks = false
this.$toast.success('Successfully reset audiobooks')

View file

@ -97,7 +97,7 @@ export default {
},
methods: {
async init() {
this.listeningStats = await this.$axios.$get(`/api/user/${this.user.id}/listeningStats`).catch((err) => {
this.listeningStats = await this.$axios.$get(`/api/me/listening-stats`).catch((err) => {
console.error('Failed to load listening sesions', err)
return []
})

View file

@ -71,7 +71,7 @@
<script>
export default {
async asyncData({ params, redirect, app }) {
var user = await app.$axios.$get(`/api/user/${params.id}`).catch((error) => {
var user = await app.$axios.$get(`/api/users/${params.id}`).catch((error) => {
console.error('Failed to get user', error)
return null
})
@ -115,11 +115,11 @@ export default {
},
methods: {
async init() {
this.listeningSessions = await this.$axios.$get(`/api/user/${this.user.id}/listeningSessions`).catch((err) => {
this.listeningSessions = await this.$axios.$get(`/api/users/${this.user.id}/listening-sessions`).catch((err) => {
console.error('Failed to load listening sesions', err)
return []
})
this.listeningStats = await this.$axios.$get(`/api/user/${this.user.id}/listeningStats`).catch((err) => {
this.listeningStats = await this.$axios.$get(`/api/users/${this.user.id}/listening-stats`).catch((err) => {
console.error('Failed to load listening sesions', err)
return []
})