Skip to content

Commit

Permalink
Clean up artist_pick_track_id in APIUser (#3381)
Browse files Browse the repository at this point in the history
  • Loading branch information
michellebrier authored May 18, 2023
1 parent 64d89ef commit 81da65e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions packages/common/src/services/audius-api-client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number | OpaqueID>
artist_pick_track_id: Nullable<OpaqueID>
blocknumber: number
balance: string
associated_wallets_balance: string
Expand Down

0 comments on commit 81da65e

Please sign in to comment.