Skip to content

Commit 87726d3

Browse files
authored
fix:OH2-450 | Fix operations table refresh after deletion and major field (#717)
1 parent a6607f6 commit 87726d3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/accessories/admin/operations/operationForm/OperationForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const OperationForm: FC<IOperationProps> = ({
126126

127127
const handleCheckboxChange = useCallback(
128128
(fieldName: string) => (value: boolean) => {
129-
setFieldValue(fieldName, value ? "0" : "1");
129+
setFieldValue(fieldName, !!value ? 1 : 0);
130130
},
131131
[setFieldValue]
132132
);

src/components/accessories/admin/operations/operationTable/OperationTable.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { useTranslation } from "react-i18next";
55
import checkIcon from "../../../../../assets/check-icon.png";
66
import { OperationDTO, OperationDTOOpeForEnum } from "../../../../../generated";
77
import { scrollToElement } from "../../../../../libraries/uiUtils/scrollToElement";
8-
import { deleteOperationReset } from "../../../../../state/operations";
8+
import {
9+
deleteOperationReset,
10+
getOperations,
11+
} from "../../../../../state/operations";
912
import ConfirmationDialog from "../../../confirmationDialog/ConfirmationDialog";
1013
import InfoBox from "../../../infoBox/InfoBox";
1114
import { TFilterField } from "../../../table/filter/types";
@@ -169,6 +172,7 @@ export const OperationTable: FunctionComponent<IOwnProps> = ({
169172
primaryButtonLabel="Ok"
170173
handlePrimaryButtonClick={() => {
171174
dispatch(deleteOperationReset());
175+
dispatch(getOperations());
172176
}}
173177
handleSecondaryButtonClick={() => ({})}
174178
/>

0 commit comments

Comments
 (0)