Skip to content

Commit

Permalink
bugfix: make the Modrinth Game Versions badge look at all versions an…
Browse files Browse the repository at this point in the history
…d not just the latest
  • Loading branch information
Ceedrich committed Sep 3, 2024
1 parent 02f6ef7 commit 0de483e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions services/modrinth/modrinth-game-versions.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ export default class ModrinthGameVersions extends BaseModrinthService {
}

async handle({ projectId }) {
const { 0: latest } = await this.fetchVersions({ projectId })
const versions = latest.game_versions
const data = await this.fetchVersions({ projectId })
const versions = [
...new Set(
data
.map(ver => ver.game_versions)
.reduce((prev, curr) => [...prev, ...curr]),
),
].sort()
return this.constructor.render({ versions })
}
}

0 comments on commit 0de483e

Please sign in to comment.