diff --git a/src/pages/api/recommendations.ts b/src/pages/api/recommendations.ts index a8dcec6..31e083f 100644 --- a/src/pages/api/recommendations.ts +++ b/src/pages/api/recommendations.ts @@ -33,6 +33,8 @@ export default async function handler( max: topTrack.body.tracks.length }) + console.log(topTrack.body.tracks[topTrackSelected].album.images) + topTrackCollection.push(topTrack.body.tracks[topTrackSelected]) } @@ -45,7 +47,8 @@ export default async function handler( id: topTrackCollection[index].id, uri: topTrackCollection[index].uri, name: topTrackCollection[index].name, - previewUrl: topTrackCollection[index].preview_url + previewUrl: topTrackCollection[index].preview_url, + images: topTrackCollection[index].album.images } })) diff --git a/src/templates/home/authenticated.tsx b/src/templates/home/authenticated.tsx index 5509b6e..a03d343 100644 --- a/src/templates/home/authenticated.tsx +++ b/src/templates/home/authenticated.tsx @@ -35,8 +35,6 @@ export const Authenticated = ({ artistId }: AuthenticatedProps) => { ) const mutation = usePlaylistMutation() - console.log(mutation.data) - const handleLike = (artist: Recommendation) => { setLiked({ id: artist.id, @@ -61,7 +59,7 @@ export const Authenticated = ({ artistId }: AuthenticatedProps) => { {data?.data.map((artist) => ( + +type Track = { + id: string + uri: string + name: string + previewUrl: string + images: Images +} + export type Recommendation = { id: string - images: Array<{ - height: number - url: string - width: number - }> + images: Images type: string name: string - track: { - id: string - uri: string - name: string - previewUrl: string - } + track: Track }