upd: fix broken returns and change if statement
This commit is contained in:
@@ -50,9 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
|
|
||||||
if (ps.instance) {
|
if (ps.instance) {
|
||||||
const meta = await this.metaService.fetch();
|
const meta = await this.metaService.fetch();
|
||||||
if (meta.donationUrl && !meta.donationUrl.includes('opencollective.com')) {
|
if (meta.donationUrl && meta.donationUrl.includes('opencollective.com')) {
|
||||||
return [];
|
|
||||||
} else if (meta.donationUrl) {
|
|
||||||
return { sponsor_data: await maybeCached('instanceSponsors', ps.forceUpdate, async () => {
|
return { sponsor_data: await maybeCached('instanceSponsors', ps.forceUpdate, async () => {
|
||||||
let totalSponsors;
|
let totalSponsors;
|
||||||
const meta = await this.metaService.fetch();
|
const meta = await this.metaService.fetch();
|
||||||
@@ -73,7 +71,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
}
|
}
|
||||||
}) };
|
}) };
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return { sponsor_data: [] };
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return { sponsor_data: await maybeCached('sponsors', ps.forceUpdate, async () => {
|
return { sponsor_data: await maybeCached('sponsors', ps.forceUpdate, async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user