mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-12-22 16:30:13 +00:00
fix: api returns all backers on users so check if tier exists
This commit is contained in:
parent
1e0d372eb5
commit
3529042cb1
1 changed files with 1 additions and 1 deletions
|
@ -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());
|
||||
|
||||
// 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
|
||||
totalSponsors = [...new Map(allSponsors.map(v => [v.profile, v])).values()];
|
||||
|
|
Loading…
Reference in a new issue