Firmware upload is functional

This commit is contained in:
2024-10-07 22:13:47 +02:00
parent cef5b5aa5b
commit 2924d14281
3 changed files with 65 additions and 12 deletions

View File

@ -12,4 +12,22 @@ export class OTAAPI {
})
).data;
}
/**
* Upload new OTA firwmare
*/
static async UploadFirmware(
platform: string,
version: string,
firmware: File
): Promise<void> {
const fd = new FormData();
fd.append("firmware", firmware);
await APIClient.exec({
method: "POST",
uri: `/ota/${platform}/${version}`,
formData: fd,
});
}
}