Change main UI layout and add VINs to add and upload forms (#16)
* Add new upload update package form Add new add vehicle form Add new side menu layout Add new toolbar layout Update and add unit tests * Enable add get and add vehicles * Integration issues with ota_update service * Update get vehicle JSON format * Fix related unit test Add release notes field * Add StatusContext to display error and status messages
This commit is contained in:
@@ -7,7 +7,7 @@ export const getCancelToken = () => {
|
||||
return token.source();
|
||||
}
|
||||
|
||||
export const uploadFile = (file, token, onProgress, cancelToken) => {
|
||||
export const uploadFile = (file, data, token, onProgress, cancelToken) => {
|
||||
const form = new FormData();
|
||||
let options = {
|
||||
method: "POST",
|
||||
@@ -24,7 +24,10 @@ export const uploadFile = (file, token, onProgress, cancelToken) => {
|
||||
onProgress(Math.min(99, Math.floor((event.loaded / event.total) * 100)));
|
||||
}
|
||||
}
|
||||
}
|
||||
form.append('file', file);
|
||||
return axios.post(UPLOAD_ENDPOINT, form, options);
|
||||
}
|
||||
for (let key in data) {
|
||||
form.append(key, data[key]);
|
||||
}
|
||||
form.append("file", file);
|
||||
return axios.post(`${UPLOAD_ENDPOINT}/upload`, form, options);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user