mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-12-22 16:30:13 +00:00
upd: fix donationUrl check position
This commit is contained in:
parent
6b459be117
commit
9dd51bc9eb
1 changed files with 15 additions and 14 deletions
|
@ -49,13 +49,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ps.instance) {
|
if (ps.instance) {
|
||||||
|
const meta = await this.metaService.fetch();
|
||||||
|
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();
|
||||||
|
|
||||||
if (meta.donationUrl && !meta.donationUrl.includes('opencollective.com')) {
|
|
||||||
return [];
|
|
||||||
} else if (meta.donationUrl) {
|
|
||||||
try {
|
try {
|
||||||
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());
|
||||||
|
|
||||||
|
@ -70,10 +71,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
}) };
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}) };
|
|
||||||
} else {
|
} else {
|
||||||
return { sponsor_data: await maybeCached('sponsors', ps.forceUpdate, async () => {
|
return { sponsor_data: await maybeCached('sponsors', ps.forceUpdate, async () => {
|
||||||
let totalSponsors;
|
let totalSponsors;
|
||||||
|
|
Loading…
Reference in a new issue