From 87726d30ca96f4e78befd45ba511df0d29d24360 Mon Sep 17 00:00:00 2001 From: Silevester Dongmo <58907550+SilverD3@users.noreply.github.com> Date: Wed, 5 Feb 2025 15:03:31 +0100 Subject: [PATCH] fix:OH2-450 | Fix operations table refresh after deletion and major field (#717) --- .../admin/operations/operationForm/OperationForm.tsx | 2 +- .../admin/operations/operationTable/OperationTable.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/accessories/admin/operations/operationForm/OperationForm.tsx b/src/components/accessories/admin/operations/operationForm/OperationForm.tsx index cd58a0ea9..8500aa90a 100644 --- a/src/components/accessories/admin/operations/operationForm/OperationForm.tsx +++ b/src/components/accessories/admin/operations/operationForm/OperationForm.tsx @@ -126,7 +126,7 @@ const OperationForm: FC = ({ const handleCheckboxChange = useCallback( (fieldName: string) => (value: boolean) => { - setFieldValue(fieldName, value ? "0" : "1"); + setFieldValue(fieldName, !!value ? 1 : 0); }, [setFieldValue] ); diff --git a/src/components/accessories/admin/operations/operationTable/OperationTable.tsx b/src/components/accessories/admin/operations/operationTable/OperationTable.tsx index b7a8f0551..a3974347c 100644 --- a/src/components/accessories/admin/operations/operationTable/OperationTable.tsx +++ b/src/components/accessories/admin/operations/operationTable/OperationTable.tsx @@ -5,7 +5,10 @@ import { useTranslation } from "react-i18next"; import checkIcon from "../../../../../assets/check-icon.png"; import { OperationDTO, OperationDTOOpeForEnum } from "../../../../../generated"; import { scrollToElement } from "../../../../../libraries/uiUtils/scrollToElement"; -import { deleteOperationReset } from "../../../../../state/operations"; +import { + deleteOperationReset, + getOperations, +} from "../../../../../state/operations"; import ConfirmationDialog from "../../../confirmationDialog/ConfirmationDialog"; import InfoBox from "../../../infoBox/InfoBox"; import { TFilterField } from "../../../table/filter/types"; @@ -169,6 +172,7 @@ export const OperationTable: FunctionComponent = ({ primaryButtonLabel="Ok" handlePrimaryButtonClick={() => { dispatch(deleteOperationReset()); + dispatch(getOperations()); }} handleSecondaryButtonClick={() => ({})} />