Skip to content

Commit

Permalink
fix(polar): Cannot read properties of undefined (reading 'type') (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
robingenz authored May 25, 2024
1 parent 85584fe commit 0f2b6ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/polar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function fetchPolarSponsors(token: string, organization?: string):
name: sub.user.public_name,
avatarUrl: sub.user.avatar_url,
login: sub.user.github_username,
type: sub.subscription_tier.type === 'individual' ? 'User' : 'Organization',
type: sub.product.type === 'individual' ? 'User' : 'Organization',
socialLogins: {
github: sub.user.github_username,
},
Expand All @@ -60,7 +60,7 @@ export async function fetchPolarSponsors(token: string, organization?: string):
provider: 'polar',
privacyLevel: 'PUBLIC',
createdAt: new Date(sub.created_at).toISOString(),
tierName: isActive ? sub.subscription_tier.name : undefined,
tierName: isActive ? sub.product.name : undefined,
monthlyDollars: isActive ? sub.price.price_amount / 100 : -1,
}
})
Expand Down

0 comments on commit 0f2b6ed

Please sign in to comment.