From 3529042cb163dd69ca78bae1093ac5bafea5a34d Mon Sep 17 00:00:00 2001 From: Marie Date: Wed, 2 Oct 2024 18:25:06 +0200 Subject: [PATCH] fix: api returns all backers on users so check if tier exists --- packages/backend/src/server/api/endpoints/sponsors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/sponsors.ts b/packages/backend/src/server/api/endpoints/sponsors.ts index 33f9d03367..3c3cdd7808 100644 --- a/packages/backend/src/server/api/endpoints/sponsors.ts +++ b/packages/backend/src/server/api/endpoints/sponsors.ts @@ -62,7 +62,7 @@ export default class extends Endpoint { // 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()];