Add package updates, car updates, and vehicle screens (#25)

This commit is contained in:
John Wu
2021-03-31 17:42:31 -07:00
committed by GitHub
parent 2d1faa8fb7
commit 17f81822c0
33 changed files with 2409 additions and 699 deletions

View File

@@ -29,5 +29,15 @@ export const uploadFile = (file, data, token, onProgress, cancelToken) => {
form.append(key, data[key]);
}
form.append("file", file);
return axios.post(`${UPLOAD_ENDPOINT}/upload`, form, options);
return axios.post(`${UPLOAD_ENDPOINT}/update`, form, options)
.then((response) => response.data)
.catch((error) => {
if (typeof error.response.data === "string") {
return {
error: error.response.statusText,
message: error.response.data,
};
}
return error.response.data;
});
};