diff --git a/src/pages/WellOperations/WellCompositeEditor/WellCompositeSections.jsx b/src/pages/WellOperations/WellCompositeEditor/WellCompositeSections.jsx index 0dc49f0..4480628 100644 --- a/src/pages/WellOperations/WellCompositeEditor/WellCompositeSections.jsx +++ b/src/pages/WellOperations/WellCompositeEditor/WellCompositeSections.jsx @@ -42,7 +42,7 @@ export const WellCompositeSections = ({ idWell, statsWells, selectedSections }) const [params, setParams] = useState([]) const [paramsColumns, setParamsColumns] = useState([]) - useEffect(() => setParamsColumns(getColumns(idWell)), [idWell]) + useEffect(() => (async() => setParamsColumns(await getColumns(idWell)))(), [idWell]) useEffect(() => { if (isOpsModalVisible || selectedWellId <= 0) return diff --git a/src/pages/WellOperations/WellDrillParams.jsx b/src/pages/WellOperations/WellDrillParams.jsx index 0c4524c..5af5355 100644 --- a/src/pages/WellOperations/WellDrillParams.jsx +++ b/src/pages/WellOperations/WellDrillParams.jsx @@ -39,16 +39,18 @@ export const WellDrillParams = ({ idWell }) => { const updateParams = useCallback(async () => await invokeWebApiWrapperAsync( async () => { const params = arrayOrDefault(await DrillParamsService.getAll(idWell)) + // Typescript против использования числа в качестве типа значения select + params.forEach((param) => param.idWellSectionType = `${param.idWellSectionType}`) setParams(params) }, setShowLoader, 'Не удалось загрузить список режимов бурения скважины' ), [idWell]) - useEffect(() => { - setColumns(getColumns(idWell)) - updateParams() - }, [idWell, updateParams]) + useEffect(() => (async () => { + setColumns(await getColumns(idWell)) + await updateParams() + })(), [idWell, updateParams]) const handlerProps = { service: DrillParamsService,