mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
build artist page
+ connect artist page to backend ~ bugs introduced as there are hashing changes in the backend [will fix later]
This commit is contained in:
committed by
Mungai Njoroge
parent
fff2c53801
commit
075765088f
@@ -0,0 +1,26 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user