diff --git a/src/utils/curseforge-utils.ts b/src/utils/curseforge-utils.ts index de40fe7..2595f4d 100644 --- a/src/utils/curseforge-utils.ts +++ b/src/utils/curseforge-utils.ts @@ -102,6 +102,14 @@ export async function convertToCurseForgeVersions(gameVersions: string[], loader } export async function uploadFile(id: string, data: Record, file: File, token: string): Promise { + if (Array.isArray(data.relations?.projects) && (!data.relations.projects.length || data.parentFileID)) { + delete data.relations; + } + + if (data.gameVersions && data.parentFileID) { + delete data.gameVersions; + } + const form = new FormData(); form.append("file", await fileFromPath(file.path), file.name); form.append("metadata", JSON.stringify(data));