From 43b1ff503e6ebb96b1ceddb7d7beed2587753f8d Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Wed, 3 Jan 2024 18:29:01 +0000 Subject: [PATCH] `getProject` no longer returns inaccurate results --- src/platforms/curseforge/curseforge-eternal-api-client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/curseforge/curseforge-eternal-api-client.ts b/src/platforms/curseforge/curseforge-eternal-api-client.ts index f3f6abb..22fb6ba 100644 --- a/src/platforms/curseforge/curseforge-eternal-api-client.ts +++ b/src/platforms/curseforge/curseforge-eternal-api-client.ts @@ -77,7 +77,7 @@ export class CurseForgeEternalApiClient { async getProject(idOrSlug: number | string): Promise { if (!isCurseForgeProjectId(idOrSlug)) { const response = await this._fetch("/mods/search", HttpRequest.get().with({ gameId: 432, slug: idOrSlug })); - return await response.json<{ data: CurseForgeProject[] }>().then(x => x?.data?.[0]) ?? undefined; + return await response.json<{ data: CurseForgeProject[] }>().then(x => x?.data?.find(y => y.slug === idOrSlug)) ?? undefined; } const response = await this._fetch(`/mods/${idOrSlug}`);