Provide default when modpack doesn't specify loader (#4930)

* fix no modpack loader, default to minecraft loader

* use v2 create then modify with v3 for environment
This commit is contained in:
Truman Gao
2025-12-18 15:54:00 -08:00
committed by GitHub
parent 8fb38ba0f2
commit 0268600044
2 changed files with 10 additions and 2 deletions

View File

@@ -179,9 +179,9 @@ export class LabrinthVersionsV3Module extends AbstractModule {
formData.append(fileParts[i], new Blob([file]), file.name)
})
return this.client.request<Labrinth.Versions.v3.Version>(`/version`, {
const newVersion = await this.client.request<Labrinth.Versions.v3.Version>(`/version`, {
api: 'labrinth',
version: 3,
version: 2,
method: 'POST',
body: formData,
timeout: 120000,
@@ -189,6 +189,12 @@ export class LabrinthVersionsV3Module extends AbstractModule {
'Content-Type': '',
},
})
await this.modifyVersion(newVersion.id, {
environment: draftVersion.environment,
})
return newVersion
}
/**