fix playlist image being lost on title edit (#29)

This commit is contained in:
Mungai Geoffrey
2022-04-14 11:31:52 +03:00
committed by GitHub
parent 2d6391b801
commit d285a3edf7
5 changed files with 17 additions and 15 deletions
+5 -5
View File
@@ -1,4 +1,4 @@
import axios from "axios";
import axios, { AxiosError } from "axios";
import state from "./state";
import { AlbumInfo, Track } from "../interfaces";
@@ -17,14 +17,14 @@ const getAlbumTracks = async (album: string, artist: string) => {
data.info = res.data.info;
data.tracks = res.data.songs;
})
.catch((err) => {
.catch((err: AxiosError) => {
console.error(err);
});
return data;
};
const getAlbumArtists = async (album, artist) => {
const getAlbumArtists = async (album:string, artist:string) => {
let artists = [];
await axios
@@ -35,7 +35,7 @@ const getAlbumArtists = async (album, artist) => {
.then((res) => {
artists = res.data.artists;
})
.catch((err) => {
.catch((err: AxiosError) => {
console.error(err);
});
@@ -53,7 +53,7 @@ const getAlbumBio = async (album: string, albumartist: string) => {
.then((res) => {
bio = res.data.bio;
})
.catch((err) => {
.catch((err: AxiosError) => {
if (err.response.status === 404) {
bio = null;
}