You've already forked AstralRinth
forked from didirus/AstralRinth
Fix version editing on modpacks returning a "too large" error (#1455)
This commit is contained in:
@@ -1117,26 +1117,32 @@ export default defineNuxtComponent({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
name: this.version.name || this.version.version_number,
|
||||||
|
version_number: this.version.version_number,
|
||||||
|
changelog: this.version.changelog,
|
||||||
|
version_type: this.version.version_type,
|
||||||
|
dependencies: this.version.dependencies,
|
||||||
|
game_versions: this.version.game_versions,
|
||||||
|
loaders: this.version.loaders,
|
||||||
|
primary_file: ['sha1', this.primaryFile.hashes.sha1],
|
||||||
|
featured: this.version.featured,
|
||||||
|
file_types: this.oldFileTypes.map((x, i) => {
|
||||||
|
return {
|
||||||
|
algorithm: 'sha1',
|
||||||
|
hash: this.version.files[i].hashes.sha1,
|
||||||
|
file_type: x ? x.value : null,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.project.project_type === 'modpack') {
|
||||||
|
delete body.dependencies
|
||||||
|
}
|
||||||
|
|
||||||
await useBaseFetch(`version/${this.version.id}`, {
|
await useBaseFetch(`version/${this.version.id}`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
body: {
|
body,
|
||||||
name: this.version.name || this.version.version_number,
|
|
||||||
version_number: this.version.version_number,
|
|
||||||
changelog: this.version.changelog,
|
|
||||||
version_type: this.version.version_type,
|
|
||||||
dependencies: this.version.dependencies,
|
|
||||||
game_versions: this.version.game_versions,
|
|
||||||
loaders: this.version.loaders,
|
|
||||||
primary_file: ['sha1', this.primaryFile.hashes.sha1],
|
|
||||||
featured: this.version.featured,
|
|
||||||
file_types: this.oldFileTypes.map((x, i) => {
|
|
||||||
return {
|
|
||||||
algorithm: 'sha1',
|
|
||||||
hash: this.version.files[i].hashes.sha1,
|
|
||||||
file_type: x ? x.value : null,
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const hash of this.deleteFiles) {
|
for (const hash of this.deleteFiles) {
|
||||||
|
|||||||
Reference in New Issue
Block a user