Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Fix version editing on modpacks returning a "too large" error
Browse files Browse the repository at this point in the history
  • Loading branch information
triphora committed Nov 20, 2023
1 parent 61a2c36 commit 621bed7
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions pages/[type]/[id]/version/[version].vue
Original file line number Diff line number Diff line change
Expand Up @@ -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}`, {
method: 'PATCH',
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,
}
}),
},
body,
})
for (const hash of this.deleteFiles) {
Expand Down

0 comments on commit 621bed7

Please sign in to comment.