import {ITreeNode} from "angular-tree-component/dist/defs/api";
import {ServiceInstance} from "../../../models/serviceInstance";
import {ServiceState} from "../main.reducer";
+import {updateServiceValidationCounter} from "../reducersHelper";
export function generalReducer(state: ServiceState, action: Action) : ServiceState {
switch (action.type) {
newState.serviceInstance[serviceId][typeNodeInformation.hierarchyName] = Object.assign({}, newState.serviceInstance[serviceId][typeNodeInformation.hierarchyName], objects);
return newState;
}
+
+
}
}
});
};
-const updateServiceValidationCounter = (newState: any, oldValidationState: boolean, newValidationState: boolean, serviceUuid: string) => {
- if (oldValidationState && !newValidationState) {
- newState.serviceInstance[serviceUuid].validationCounter--;
- } else if (!oldValidationState && newValidationState) {
- newState.serviceInstance[serviceUuid].validationCounter++;
- }
-};