CEC-4523: Add bulk archive support (#379)
* CEC-4523: add archive endpoint and action
This commit is contained in:
@@ -5,6 +5,10 @@ const manifestsAPI = {
|
||||
return data;
|
||||
},
|
||||
|
||||
archiveManifest: async (data, token) => {
|
||||
return { message: "Archived 1 update manifests" };
|
||||
},
|
||||
|
||||
deleteManifest: async (manifest_id, token) => {
|
||||
return { message: "OK" };
|
||||
},
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
import {
|
||||
addQueryParams, errorHandler, fetchRespHandler, getAuthHeaderOptions
|
||||
addQueryParams, errorHandler, fetchRespHandler, getAuthHeaderOptions
|
||||
} from "../utils/http";
|
||||
|
||||
const API_ENDPOINT = process.env.REACT_APP_OTA_SERVICE_URL;
|
||||
|
||||
const manifestsAPI = {
|
||||
archiveManifest: async (data, token) =>
|
||||
fetch(`${API_ENDPOINT}/vehicles/archive`, {
|
||||
method: "PUT",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
deleteManifest: async (manifest_id, token) =>
|
||||
fetch(`${API_ENDPOINT}/manifest?id=${manifest_id}`, {
|
||||
method: "DELETE",
|
||||
@@ -79,8 +91,8 @@ const manifestsAPI = {
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
migrateManifest: async (manifest_id, token) =>
|
||||
fetch(`${API_ENDPOINT}/manifestmigrate/${manifest_id}`,{
|
||||
migrateManifest: async (manifest_id, token) =>
|
||||
fetch(`${API_ENDPOINT}/manifestmigrate/${manifest_id}`, {
|
||||
method: "POST",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
|
||||
Reference in New Issue
Block a user