fix: firmware upload failure

This commit is contained in:
2025-09-15 21:12:00 +02:00
parent d01f094edd
commit 2dbba87098
2 changed files with 22 additions and 2 deletions

View File

@@ -94,13 +94,19 @@ class ApiClient {
async uploadFirmware(file, nodeIp) {
const formData = new FormData();
formData.append('file', file);
return this.request(`/api/node/update`, {
const data = await this.request(`/api/node/update`, {
method: 'POST',
query: { ip: nodeIp },
body: formData,
isForm: true,
headers: {},
});
// Some endpoints may return HTTP 200 with success=false on logical failure
if (data && data.success === false) {
const message = data.message || 'Firmware upload failed';
throw new Error(message);
}
return data;
}
}