Skip to content

Commit

Permalink
fix: type of artists
Browse files Browse the repository at this point in the history
  • Loading branch information
moekify committed Aug 18, 2024
1 parent b1cd9be commit e5fab79
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,19 @@ export const load = async () => {
if (!artist.artists_id || typeof artist !== 'object') {
return;
}
const { id, artist_name, image, slug } = artist.artists_id as {
id: number;
artist_name: string;
slug: string;
image: string | null;
};

return {
id: artist.artists_id.id,
slug: artist.artists_id.slug,
name: artist.artists_id.artist_name,
imageUrl: artist.artists_id.image
? import.meta.env.VITE_DIRECTUS_URL +
'assets/' +
artist.artists_id.image +
'?key=artist-square'
id,
slug,
name: artist_name,
imageUrl: image
? import.meta.env.VITE_DIRECTUS_URL + 'assets/' + image + '?key=artist-square'
: '/placeholder_artists.png'
};
})
Expand Down

0 comments on commit e5fab79

Please sign in to comment.