Убрана информация об id скважины

This commit is contained in:
ts_salikhov 2022-10-19 15:19:19 +04:00
parent 53a1d33a55
commit 5dd1fc8258

View File

@ -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() {
<>
Вы перешли к странице загрузки файла!
<br />
Файл "{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/*',
}, <AccessDenied />)