geoffrey45 075765088f build artist page
+ connect artist page to backend
~ bugs introduced as there are hashing changes in the backend

[will fix later]
2023-01-13 18:13:49 +03:00

27 lines
495 B
TypeScript

import { paths } from "@/config";
import useAxios from "./useAxios";
import { Artist, Track, Album } from "@/interfaces";
const getArtistData = async (hash: string) => {
interface ArtistData {
artist: Artist;
albums: Album[];
tracks: Track[];
}
const { data, error } = await useAxios({
get: true,
url: paths.api.artist + `/${hash}`,
});
if (error) {
console.error(error);
}
console.log(data);
return data as ArtistData;
};
export { getArtistData };