Skip to content

Commit

Permalink
Use defaultAudio instead of getting the first audio in the array [M…
Browse files Browse the repository at this point in the history
…A-165]
  • Loading branch information
nikhiltri committed Mar 4, 2024
1 parent 1628bc5 commit 756a5c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Models/Transformers/StopTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function transform(TwillModelContract $stop): array
$nid = Util::cantorPair($objectType, $stop->object_id);
return [
'object' => $nid,
'audio_id' => (string) $stop->selector?->audios->first()?->id,
'audio_id' => (string) $stop->selector?->defaultAudio?->id,
'audio_bumper' => null, // Legacy from Drupal
'sort' => $stop->pivot->position,
];
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Transformers/TourTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function transform(TwillModelContract $tour): array
'description' => $tour->description,
'intro' => $tour->intro,
'tour_duration' => $tour->duration_in_minutes,
'tour_audio' => $tour->selector?->audios->first()?->id,
'tour_audio' => $tour->selector?->defaultAudio?->id,
'category' => null, // Legacy from Drupal
'weight' => $tour->position,
];
Expand Down

0 comments on commit 756a5c8

Please sign in to comment.