Skip to content

Commit

Permalink
chore(artist): add feat field
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolvs committed Mar 9, 2024
1 parent 3f93fc1 commit 2dacd4b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/api/artist/artist.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const getArtistBySlug = async (slug: string) => {
releases: {
include: {
type: true,
artists: true,
discs: {
include: {
tracks: true
Expand Down Expand Up @@ -149,7 +150,12 @@ export const getArtistBySlug = async (slug: string) => {
discs: release.discs.map(disc => ({
number: disc.number,
tracks: disc.tracks.map(({ name }) => name)
}))
})),
feat: release.artists.flatMap((featArtist) => (
featArtist.slug === slug
? []
: { name: featArtist.name, slug: featArtist.slug }
))
}))
}
}

0 comments on commit 2dacd4b

Please sign in to comment.