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