From ca9ffe3bd9f9a74df467a3a6622b64693b525dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Fri, 20 Aug 2021 15:43:13 +0500 Subject: [PATCH] fix Archive page --- src/pages/Archive.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pages/Archive.jsx b/src/pages/Archive.jsx index 4435f8a..3a9f28b 100644 --- a/src/pages/Archive.jsx +++ b/src/pages/Archive.jsx @@ -5,7 +5,6 @@ import { Row, Col, Tooltip} from 'antd' -import { useParams } from 'react-router-dom' import { DataService } from '../services/api' import {generateUUID} from '../services/UidGenerator' import { ArchiveColumn } from '../components/ArchiveColumn' @@ -25,8 +24,7 @@ const LoadObject = (key) => { return json ? JSON.parse(json) : null } -export default function Archive() { - let { id } = useParams(); +export default function Archive({idWell}) { const [saubData, setSaubData] = useState([]) const [chartsCfgs, setChartsCfgs] = useState([]) const [rangeDate, setRangeDate] = useState([moment().subtract(3,'hours'), moment()]) @@ -96,14 +94,14 @@ export default function Archive() { let startDate = rangeDate[0].toISOString() setLoader(true) - DataService.getData(id, startDate, interval, 2048) + DataService.getData(idWell, startDate, interval, 2048) .then(handleReceiveDataSaub) .catch(error => { - notify(`Не удалось загрузить данные по скважине (${id}) c ${rangeDate[0]} по ${rangeDate[1]}`, 'error') + notify(`Не удалось загрузить данные по скважине (${idWell}) c ${rangeDate[0]} по ${rangeDate[1]}`, 'error') console.error(error) }) .finally(()=>setLoader(false)) - }, [id, rangeDate]); + }, [idWell, rangeDate]); let charts = null if(chartsCfgs.length > 0){