CEC-4640: add bulk add to fleet (#384)

* refactor bulkactions component

* refactor bulk actions

* update dom tests

* add addToFleet hook

* make signal optional

* implement code splitting

* add deps

* remove test label
This commit is contained in:
Tristan Timblin
2023-07-10 17:30:11 -04:00
committed by GitHub
parent db88d5eba1
commit 754e445c09
33 changed files with 739 additions and 437 deletions

View File

@@ -1,5 +1,5 @@
import {
addQueryParams, errorHandler, fetchRespHandler, getAuthHeaderOptions
addQueryParams, errorHandler, fetchRespHandler, getAuthHeaderOptions
} from "../utils/http";
const API_ENDPOINT = process.env.REACT_APP_OTA_SERVICE_URL;
@@ -28,13 +28,14 @@ const fleetsAPI = {
.then(fetchRespHandler)
.catch(errorHandler),
getFleets: async (search, token) =>
getFleets: async (search, token, controller) =>
fetch(addQueryParams(`${API_ENDPOINT}/fleets`, search), {
method: "GET",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
signal: controller?.signal,
})
.then(fetchRespHandler)
.catch(errorHandler),