From 81da65e9ca661115c281a4f49ab0bb67ccf6d692 Mon Sep 17 00:00:00 2001 From: Michelle Brier Date: Wed, 17 May 2023 20:28:40 -0700 Subject: [PATCH] Clean up artist_pick_track_id in APIUser (#3381) --- .../src/services/audius-api-client/ResponseAdapter.ts | 11 +++-------- .../common/src/services/audius-api-client/types.ts | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/common/src/services/audius-api-client/ResponseAdapter.ts b/packages/common/src/services/audius-api-client/ResponseAdapter.ts index d0a3f222a36..ced7ba58db0 100644 --- a/packages/common/src/services/audius-api-client/ResponseAdapter.ts +++ b/packages/common/src/services/audius-api-client/ResponseAdapter.ts @@ -38,14 +38,9 @@ export const makeUser = ( return undefined } - // TODO remove conditional once all DNs are encoding the artist pick ID - let decoded_artist_pick_track_id: number | null - if (typeof user.artist_pick_track_id === 'string') { - decoded_artist_pick_track_id = decodeHashId(user.artist_pick_track_id) - } else { - decoded_artist_pick_track_id = user.artist_pick_track_id - } - + const decoded_artist_pick_track_id = user.artist_pick_track_id + ? decodeHashId(user.artist_pick_track_id) + : null const balance = user.balance as StringWei const associated_wallets_balance = user.associated_wallets_balance as StringWei diff --git a/packages/common/src/services/audius-api-client/types.ts b/packages/common/src/services/audius-api-client/types.ts index 9668d65c246..29ff0f4e38e 100644 --- a/packages/common/src/services/audius-api-client/types.ts +++ b/packages/common/src/services/audius-api-client/types.ts @@ -23,8 +23,7 @@ export type OpaqueID = string export type APIUser = { album_count: number - // TODO remove number type once all DNs are encoding the artist pick ID - artist_pick_track_id: Nullable + artist_pick_track_id: Nullable blocknumber: number balance: string associated_wallets_balance: string