diff --git a/src/hooks/useAffiliatesLeaderboard.ts b/src/hooks/useAffiliatesLeaderboard.ts index f8587813f..9443ed59e 100644 --- a/src/hooks/useAffiliatesLeaderboard.ts +++ b/src/hooks/useAffiliatesLeaderboard.ts @@ -25,10 +25,12 @@ export const useAffiliatesLeaderboard = () => { }); const data = await response.json(); - return data?.affiliateList?.map((stat: IAffiliateStats, i: number) => ({ - ...stat, - rank: i + 1, - })); + return data?.affiliateList + ?.filter((stat: IAffiliateStats) => Boolean(stat.affiliateReferralCode)) + ?.map((stat: IAffiliateStats, i: number) => ({ + ...stat, + rank: i + 1, + })); } catch (error) { log('useAffiliateLeaderboard', error, { endpoint }); throw error;