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:
20
src/services/vehicles.js
Normal file
20
src/services/vehicles.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const API_ENDPOINT = process.env.REACT_APP_UPLOAD_SERVICE_URL || "https://gw-dev.fiskerdps.com/ota_update";
|
||||
|
||||
const getOptions = (token) => ({
|
||||
headers: {
|
||||
"Authorization": `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
|
||||
const vehiclesAPI = {
|
||||
getVehicles: async (search, token) => {
|
||||
return axios.get(`${API_ENDPOINT}/vehicles`, getOptions(token));
|
||||
},
|
||||
addVehicle: async (vehicle, token) => {
|
||||
return axios.post(`${API_ENDPOINT}/vehicle`, vehicle, getOptions(token));
|
||||
}
|
||||
};
|
||||
|
||||
export default vehiclesAPI;
|
||||
Reference in New Issue
Block a user