Skip to content

Commit

Permalink
fix(server): casts were missing from response
Browse files Browse the repository at this point in the history
  • Loading branch information
ADRFranklin committed Jun 5, 2024
1 parent 94f2366 commit d390e2f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions server/src/resources/show/mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,41 @@ export class ShowMapper
name: creator.name,
profile_path: creator.thumbnail,
})) || [],
credits: {
cast:
copy.roles?.actors?.map((actor) => ({
name: actor.name,
character: actor.character,
profile_path: actor.thumbnail,
})) || [],
crew: [
...(copy.roles?.directors?.map((director) => ({
name: director.name,
job: 'Director',
profile_path: director.thumbnail,
})) || []),
...(copy.roles?.writers?.map((writer) => ({
name: writer.name,
job: 'Writer',
profile_path: writer.thumbnail,
})) || []),
...(copy.roles?.authors?.map((author) => ({
name: author.name,
job: 'Author',
profile_path: author.thumbnail,
})) || []),
...(copy.roles?.producers?.map((producer) => ({
name: producer.name,
job: 'Producer',
profile_path: producer.thumbnail,
})) || []),
...(copy.roles?.executiveProducers?.map((executiveProducer) => ({
name: executiveProducer.name,
job: 'Executive Producer',
profile_path: executiveProducer.thumbnail,
})) || []),
],
},
spoken_languages: copy.language?.spoken.map((language) => ({
name: language,
})),
Expand Down

0 comments on commit d390e2f

Please sign in to comment.