CEC-2144, CEC-2338 Add deploy by fleets and fix fleets table (#192)

* Add fix for fleets search

* Decompose fleets table

* Add deploy by fleets

* Add snapshots
This commit is contained in:
arpanetus
2022-08-30 03:31:26 +06:00
committed by GitHub
parent aa36b2eb91
commit 8d0dbf8030
11 changed files with 1210 additions and 663 deletions

View File

@@ -5,6 +5,12 @@ const updatesAPI = {
return data;
},
createFleetUpdates: async (data, token) => {
if (!data.id) data.id = 0;
data.id++;
return data;
},
getCarUpdates: async (filter, token) => {
return { data: [] };
},

View File

@@ -7,18 +7,23 @@ import {
const API_ENDPOINT = process.env.REACT_APP_UPLOAD_SERVICE_URL;
const createDeployUpdatesClosure = (suffix) => {
return async (data, token) => fetch(`${API_ENDPOINT}/${suffix}`, {
method: "POST",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
body: JSON.stringify(data),
})
.then(fetchRespHandler)
.catch(errorHandler)
}
const updatesAPI = {
createCarUpdates: async (data, token) =>
fetch(`${API_ENDPOINT}/carupdate`, {
method: "POST",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
body: JSON.stringify(data),
})
.then(fetchRespHandler)
.catch(errorHandler),
createFleetUpdates: createDeployUpdatesClosure("fleetupdate"),
createCarUpdates: createDeployUpdatesClosure("carupdate"),
getCarUpdateLog: async (query, token) => {
const u = addQueryParams(`${API_ENDPOINT}/carupdateslog`, query);