Skip to content

Commit

Permalink
dont show no referral code
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaszheng committed Dec 13, 2024
1 parent abfb1f0 commit 117735d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/hooks/useAffiliatesLeaderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 117735d

Please sign in to comment.