Files
shields/services/opencollective/opencollective-all.service.js
2021-07-09 12:53:55 +01:00

24 lines
611 B
JavaScript

import OpencollectiveBase from './opencollective-base.js'
export default class OpencollectiveAll extends OpencollectiveBase {
static route = this.buildRoute('all')
static examples = [
{
title: 'Open Collective backers and sponsors',
namedParams: { collective: 'shields' },
staticPreview: this.render(35),
keywords: ['opencollective'],
},
]
static defaultBadgeData = {
label: 'backers and sponsors',
}
async handle({ collective }) {
const { backersCount } = await this.fetchCollectiveInfo(collective)
return this.constructor.render(backersCount)
}
}