diff --git a/src/pages/FileDownload.jsx b/src/pages/FileDownload.jsx index 496826b..810894e 100644 --- a/src/pages/FileDownload.jsx +++ b/src/pages/FileDownload.jsx @@ -5,17 +5,16 @@ import { Button, Result, Typography } from 'antd' import { downloadFile, invokeWebApiWrapperAsync } from '@components/factory' import { wrapPrivateComponent } from '@utils' -import { FileService, WellService } from '@api' +import { FileService } from '@api' import AccessDenied from './AccessDenied' const { Paragraph, Text } = Typography -export const getLinkToFile = (fileInfo) => `/file_download/${fileInfo.idWell}/${fileInfo.id}` +export const getLinkToFile = (fileInfo) => `/file_download/${fileInfo.id}` const FileDownload = memo(function FileDownload() { - const { idWell, idFile } = useParams() - const [well, setWell] = useState({}) + const { idFile } = useParams() const [file, setFile] = useState({}) const [isError, setIsError] = useState(false) @@ -23,15 +22,6 @@ const FileDownload = memo(function FileDownload() { const location = useLocation() const isFirstOpenApp = useMemo(() => location.key === 'default', [location]) - useEffect(() => { - invokeWebApiWrapperAsync( - async () => setWell(await WellService.get(idWell)), - null, - 'Не удалось получить информацию о скважине', - { actionName: 'Получение данных о скважине' } - ) - }, [idWell]) - useEffect(() => { invokeWebApiWrapperAsync( async () => { @@ -60,7 +50,7 @@ const FileDownload = memo(function FileDownload() { <> Вы перешли к странице загрузки файла!
- Файл "{file?.name ?? ('№' + idFile)}", скважина "{well.caption ?? ('№' + idWell)}". + Файл "{file?.name ?? ('№' + idFile)}". )} // subTitle={} @@ -106,5 +96,5 @@ FileDownload.displayName = 'FileDownloadMemo' export default wrapPrivateComponent(FileDownload, { requirements: ['File.get'], - route: 'file_download/:idWell/:idFile/*', + route: 'file_download/:idFile/*', }, )