CEC-247, CEC-261 Manifest and ECU display (#65)

* CEC-261 Add ECU list control

* CEC-261 Update vehicle service mock

* CEC-247 Manifest screens

* Fix test

* Remove dynamic dates from mocks

* Remove timezone from mock dates

* Fix test for date string timezone difference
This commit is contained in:
John Wu
2021-07-16 10:49:10 -07:00
committed by GitHub
parent ab37cd598f
commit 83105fb7ca
26 changed files with 3626 additions and 240 deletions

23
src/services/manifests.js Normal file
View File

@@ -0,0 +1,23 @@
import { getAuthHeaderOptions, fetchRespHandler, addQueryParams } from "../utils/http";
const API_ENDPOINT = process.env.REACT_APP_UPLOAD_SERVICE_URL || "https://gw-dev.fiskerdps.com/ota_update";
const manifestsAPI = {
deleteManifest: async (manifest_id, token) => fetch(`${API_ENDPOINT}/manifest?id=${manifest_id}`, {
method: "DELETE",
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
})
.then(fetchRespHandler),
getManifests: async (search, token) => {
var u = addQueryParams(`${API_ENDPOINT}/manifests`, search);
return fetch(u, {
method: "GET",
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
})
.then(fetchRespHandler);
},
};
export default manifestsAPI;