Skip to content

Commit

Permalink
allow create notification to handle playlist id as array or int (#3190)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrina-kiam authored Apr 7, 2023
1 parent d357b3b commit cc0b56d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/common/src/services/audius-backend/AudiusBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2277,9 +2277,10 @@ export const audiusBackend = ({
const data = action.data
if ('playlist_id' in data) {
entityType = data.is_album ? Entity.Album : Entity.Playlist
return data.playlist_id.map((playlist_id) =>
decodeHashId(playlist_id)
)
const playlist_ids = Array.isArray(data.playlist_id)
? data.playlist_id
: [data.playlist_id]
return playlist_ids.map((playlist_id) => decodeHashId(playlist_id))
}
entityType = Entity.Track
return decodeHashId(data.track_id)
Expand Down

0 comments on commit cc0b56d

Please sign in to comment.