Skip to content
Snippets Groups Projects

CE-2068: replace useOperationsSearch & useOngoingCommand with common api

Merged CE-2068: replace useOperationsSearch & useOngoingCommand with common api
Merged Christina Jenks requested to merge CE-2068-replace-useOperationsSearch into develop
2 files
+ 0
25
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 0
24
@@ -229,30 +229,6 @@ export function unpackOngoingOperations(input) {
return output.totalCount > 0 ? output.operationsList[0] : null;
}
export function useOngoingCommand(iocId) {
const api = useContext(apiContext);
const method = useCallAndUnpack(
api.apis.Deployments.listOperations,
unpackOngoingOperations
);
const boundMethod = useCallback(
method.bind(null, { ioc_id: iocId, type: "COMMAND", status: "ONGOING" }),
[iocId]
);
return useAsync({
fcn: boundMethod,
call: false,
init: emptyOperationsListResponse
});
}
const emptyOperationsListResponse = {
totalCount: 0,
pageNumber: 0,
limit: 0,
operationsList: []
};
export function unpackOperation(operation) {
const d = { ...operation };
return d;
Loading