mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-21 16:00:59 -05:00
getProject
no longer returns inaccurate results
This commit is contained in:
parent
4ea0380bed
commit
43b1ff503e
1 changed files with 1 additions and 1 deletions
|
@ -77,7 +77,7 @@ export class CurseForgeEternalApiClient {
|
|||
async getProject(idOrSlug: number | string): Promise<CurseForgeProject | undefined> {
|
||||
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}`);
|
||||
|
|
Loading…
Reference in a new issue