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:
@@ -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: [] };
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user