rewrite some fetch methods to use the useAxios hook

This commit is contained in:
geoffrey45
2022-06-16 14:18:45 +03:00
parent 600b267ce4
commit 92e2420174
17 changed files with 305 additions and 284 deletions
+2 -1
View File
@@ -4,7 +4,7 @@ import {
getAlbumTracks,
getAlbumArtists,
getAlbumBio,
} from "../../composables/album";
} from "../../composables/fetch/album";
export default defineStore("album", {
state: () => ({
@@ -21,6 +21,7 @@ export default defineStore("album", {
* @param albumartist artist of the album
*/
async fetchTracksAndArtists(title: string, albumartist: string) {
const tracks = await getAlbumTracks(title, albumartist);
const artists = await getAlbumArtists(title, albumartist);
+1 -1
View File
@@ -1,5 +1,5 @@
import { defineStore } from "pinia";
import { getPlaylist } from "../../composables/playlists";
import { getPlaylist } from "../../composables/fetch/playlists";
import { Track, Playlist } from "../../interfaces";
export default defineStore("playlist-tracks", {
+1 -1
View File
@@ -1,6 +1,6 @@
import { defineStore } from "pinia";
import { Playlist } from "../../interfaces";
import { getAllPlaylists } from "../../composables/playlists";
import { getAllPlaylists } from "../../composables/fetch/playlists";
export default defineStore("playlists", {
state: () => ({