Replace existing axios calls with native https calls

This commit is contained in:
advplyr
2023-09-17 12:43:50 -05:00
parent 7541e4b660
commit 01178d00bf
15 changed files with 40 additions and 88 deletions
+2 -2
View File
@@ -30,8 +30,8 @@ export default {
return
}
this.loadedLibraryId = this.currentLibraryId
this.authors = await this.$axios
.$get(`/api/libraries/${this.currentLibraryId}/authors`)
this.authors = await this.$nativeHttp
.get(`/api/libraries/${this.currentLibraryId}/authors`)
.then((response) => response.authors)
.catch((error) => {
console.error('Failed to load authors', error)
+4 -4
View File
@@ -465,8 +465,8 @@ export default {
}
if (serverItemProgressId) {
await this.$axios
.$delete(`/api/me/progress/${serverItemProgressId}`)
await this.$nativeHttp
.delete(`/api/me/progress/${serverItemProgressId}`)
.then(() => {
console.log('Progress reset complete')
this.$toast.success(`Your progress was reset`)
@@ -519,8 +519,8 @@ export default {
if (value) {
this.processing = true
this.$axios
.$delete(`/api/podcasts/${this.serverLibraryItemId}/episode/${this.serverEpisodeId}?hard=1`)
this.$nativeHttp
.delete(`/api/podcasts/${this.serverLibraryItemId}/episode/${this.serverEpisodeId}?hard=1`)
.then(() => {
this.$toast.success('Episode deleted from server')
this.$router.replace(`/item/${this.serverLibraryItemId}`)
+4 -4
View File
@@ -651,8 +651,8 @@ export default {
}
if (this.serverLibraryItemId && serverMediaProgressId) {
await this.$axios
.$delete(`/api/me/progress/${serverMediaProgressId}`)
await this.$nativeHttp
.delete(`/api/me/progress/${serverMediaProgressId}`)
.then(() => {
console.log('Progress reset complete')
this.$toast.success(`Your progress was reset`)
@@ -798,8 +798,8 @@ export default {
const updatePayload = {
isFinished: !this.userIsFinished
}
this.$axios
.$patch(`/api/me/progress/${this.libraryItemId}`, updatePayload)
this.$nativeHttp
.patch(`/api/me/progress/${this.libraryItemId}`, updatePayload)
.catch((error) => {
console.error('Failed', error)
this.$toast.error(`Failed to mark as ${updatePayload.isFinished ? 'Finished' : 'Not Finished'}`)