From cc0b56d36128519d167f623405434955628d8836 Mon Sep 17 00:00:00 2001 From: sabrina-kiam <109105561+sabrina-kiam@users.noreply.github.com> Date: Fri, 7 Apr 2023 15:03:08 -0400 Subject: [PATCH] allow create notification to handle playlist id as array or int (#3190) --- .../common/src/services/audius-backend/AudiusBackend.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/common/src/services/audius-backend/AudiusBackend.ts b/packages/common/src/services/audius-backend/AudiusBackend.ts index 1c53d0a2c3b..bdbfc5c9c8c 100644 --- a/packages/common/src/services/audius-backend/AudiusBackend.ts +++ b/packages/common/src/services/audius-backend/AudiusBackend.ts @@ -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)