Skip to content

Commit

Permalink
fix(api): Fix track add action timing out because of recursive toArra…
Browse files Browse the repository at this point in the history
…y() method (#597)
  • Loading branch information
Maniload authored Oct 29, 2023
1 parent 1d205a8 commit 5302b2b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/Models/List/Playlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,14 @@ public function tracks(): HasMany
{
return $this->hasMany(PlaylistTrack::class, PlaylistTrack::ATTRIBUTE_PLAYLIST);
}

/**
* Only get the attributes as an array to prevent recursive toArray() calls.
*
* @return array
*/
public function toSearchableArray(): array
{
return $this->attributesToArray();
}
}

0 comments on commit 5302b2b

Please sign in to comment.