From 809853ada1bddb3e8af67652db787824963c4f43 Mon Sep 17 00:00:00 2001 From: Pierce Thompson <52843537+Insprill@users.noreply.github.com> Date: Tue, 8 Nov 2022 05:17:54 -0500 Subject: [PATCH] Update the [modrinth] API to v2 (#8600) * Update the Modrinth API to v2 * Rename the modId pattern to projectId --- services/modrinth/modrinth.service.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/modrinth/modrinth.service.js b/services/modrinth/modrinth.service.js index e1682affac405..acbf47b905b9c 100644 --- a/services/modrinth/modrinth.service.js +++ b/services/modrinth/modrinth.service.js @@ -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/api/v1/mod/${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 }) } }