Skip to content

Commit

Permalink
Rename the modId pattern to projectId
Browse files Browse the repository at this point in the history
  • Loading branch information
Insprill committed Nov 8, 2022
1 parent 3686b75 commit 6174cf9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions services/modrinth/modrinth.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ export default class Modrinth extends BaseJsonService {

static route = {
base: 'modrinth/dt',
pattern: ':modId',
pattern: ':projectId',
}

static examples = [
{
title: 'Modrinth',
namedParams: { modId: 'AANobbMI' },
namedParams: { projectId: 'AANobbMI' },
staticPreview: renderDownloadsBadge({ downloads: 120000 }),
},
]

static defaultBadgeData = { label: 'downloads' }

async fetch({ modId }) {
async fetch({ projectId }) {
return this._requestJson({
schema,
url: `https://api.modrinth.com/v2/project/${modId}`,
url: `https://api.modrinth.com/v2/project/${projectId}`,
})
}

async handle({ modId }) {
const { downloads } = await this.fetch({ modId })
async handle({ projectId }) {
const { downloads } = await this.fetch({ projectId })
return renderDownloadsBadge({ downloads })
}
}

0 comments on commit 6174cf9

Please sign in to comment.