fix: api returns all backers on users so check if tier exists
This commit is contained in:
parent
1e0d372eb5
commit
3529042cb1
@ -62,7 +62,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
const backers = await fetch(`${meta.donationUrl}/members/users.json`).then((response) => response.json());
|
const backers = await fetch(`${meta.donationUrl}/members/users.json`).then((response) => response.json());
|
||||||
|
|
||||||
// Merge both together into one array and make sure it only has Active subscriptions
|
// Merge both together into one array and make sure it only has Active subscriptions
|
||||||
const allSponsors = [...backers].filter(sponsor => sponsor.isActive === true && sponsor.role === 'BACKER');
|
const allSponsors = [...backers].filter(sponsor => sponsor.isActive === true && sponsor.role === 'BACKER' && sponsor.tier);
|
||||||
|
|
||||||
// Remove possible duplicates
|
// Remove possible duplicates
|
||||||
totalSponsors = [...new Map(allSponsors.map(v => [v.profile, v])).values()];
|
totalSponsors = [...new Map(allSponsors.map(v => [v.profile, v])).values()];
|
||||||
|
Loading…
Reference in New Issue
Block a user