Skip to content
Snippets Groups Projects

CE-2075: Convert useHostIOCList

Merged CE-2075: Convert useHostIOCList
All threads resolved!
Merged Alexander Madsen requested to merge ce-2075-convert-usehostlist into develop
All threads resolved!
Files
2
+ 0
29
@@ -380,13 +380,6 @@ export function useCSEntrySearch() {
return useAsync({ fcn: method, call: false, init: emptyHostListResponse });
}
const emptyHostIocListResponse = {
totalCount: 0,
pageNumber: 0,
limit: 0,
deployedList: []
};
export function unpackRecord(record) {
return { ...record };
}
@@ -429,28 +422,6 @@ export function useRecord(name, onError) {
return useAsync({ fcn: boundMethod, onError: onError });
}
export function unpackHostIOCList(iocs) {
const deployedArr = iocs.deployedIocs.map((ioc) => unpackIocInfo(ioc));
let unpackedHostIocList = {
totalCount: iocs.totalCount,
pageNumber: iocs.pageNumber,
limit: iocs.limit,
deployedList: deployedArr
};
return unpackedHostIocList;
}
export function useHostIOCList() {
const api = useContext(apiContext);
const method = useCallAndUnpack(
(params) => api.apis.Hosts.findAssociatedIocsByHostId(params),
unpackHostIOCList
);
return useAsync({ fcn: method, call: false, init: emptyHostIocListResponse });
}
export function unpackLogin(loginResponse) {
return { ...loginResponse };
}
Loading