Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include collectives in organization(s) and sponsor(s) member stats #503

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkurz
Copy link

@mkurz mkurz commented Nov 28, 2021

While working on #502 I found out that when fetching organisations/sponsors for the banner the type that will be fetched from the api gets set to ORGANIZATION and COLLECTIVE:

if (backerType.match(/sponsor/i) || backerType.match(/organization/i)) {
type = 'ORGANIZATION,COLLECTIVE';
} else {
type = 'USER';
}

When fetching the member stats (for the badge) you only count organizations however, but not collectives:

if (backerType.match(/sponsor/i) || backerType.match(/organization/i)) {
count = res.Collective.stats.backers.organizations;

Isn't that inconsistent?
Either you should never take into account collectives or add them to the stats as well (what my pull request does).
If you think the former is better, feel free to close this pull request, I can add another one removing COLLECTIVE from the first code snippet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant