From f08ef28d548c78658e57fd31d1e987851f36d0e2 Mon Sep 17 00:00:00 2001 From: Marie Date: Wed, 2 Oct 2024 19:39:06 +0200 Subject: [PATCH] upd: fix broken returns and change if statement --- packages/backend/src/server/api/endpoints/sponsors.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/sponsors.ts b/packages/backend/src/server/api/endpoints/sponsors.ts index dadc6eb819..cfea15ba31 100644 --- a/packages/backend/src/server/api/endpoints/sponsors.ts +++ b/packages/backend/src/server/api/endpoints/sponsors.ts @@ -50,9 +50,7 @@ export default class extends Endpoint { // eslint- if (ps.instance) { const meta = await this.metaService.fetch(); - if (meta.donationUrl && !meta.donationUrl.includes('opencollective.com')) { - return []; - } else if (meta.donationUrl) { + if (meta.donationUrl && meta.donationUrl.includes('opencollective.com')) { return { sponsor_data: await maybeCached('instanceSponsors', ps.forceUpdate, async () => { let totalSponsors; const meta = await this.metaService.fetch(); @@ -73,7 +71,7 @@ export default class extends Endpoint { // eslint- } }) }; } else { - return []; + return { sponsor_data: [] }; } } else { return { sponsor_data: await maybeCached('sponsors', ps.forceUpdate, async () => {