Use set on the formData instead of append

This commit is contained in:
Oliver 2025-11-17 21:25:43 -07:00
parent aa7c231e58
commit 39d122a882

View file

@ -26,7 +26,7 @@ async function main() {
// Upload the release archive // Upload the release archive
const archiveFormData = new FormData(); const archiveFormData = new FormData();
const archive = createReadStream(`release.zip`); const archive = createReadStream(`release.zip`);
archiveFormData.append(`release`, archive, `release.zip`); archiveFormData.set(`release`, archive, `release.zip`);
await axios.post( await axios.post(
`${API}/repos/${REPO}/releases/${release.data.id}/assets`, `${API}/repos/${REPO}/releases/${release.data.id}/assets`,
archiveFormData, archiveFormData,
@ -38,7 +38,7 @@ async function main() {
// Upload the manifest file // Upload the manifest file
const formData = new FormData(); const formData = new FormData();
const manifest = createReadStream(`system.json`); const manifest = createReadStream(`system.json`);
formData.append(`manifest`, manifest, `system.json`); formData.set(`manifest`, manifest, `system.json`);
await axios.post( await axios.post(
`${API}/repos/${REPO}/releases/${release.data.id}/assets`, `${API}/repos/${REPO}/releases/${release.data.id}/assets`,
formData, formData,