forked from ddrilling/asb_cloud_front
Исправлена работа очистки операций перед импортом
This commit is contained in:
parent
c3200427e4
commit
e7306eae79
@ -6,7 +6,7 @@ import { ErrorFetch } from '@components/ErrorFetch'
|
|||||||
import { UploadForm } from '@components/UploadForm'
|
import { UploadForm } from '@components/UploadForm'
|
||||||
|
|
||||||
const errorTextStyle = { color: 'red', fontWeight: 'bold' }
|
const errorTextStyle = { color: 'red', fontWeight: 'bold' }
|
||||||
const uploadFormStyle = { marginTop: '24px' }
|
const uploadFormStyle = { marginTop: 24 }
|
||||||
|
|
||||||
export const ImportOperations = memo(({ well: givenWell, onDone }) => {
|
export const ImportOperations = memo(({ well: givenWell, onDone }) => {
|
||||||
const [deleteBeforeImport, setDeleteBeforeImport] = useState(false)
|
const [deleteBeforeImport, setDeleteBeforeImport] = useState(false)
|
||||||
@ -15,7 +15,7 @@ export const ImportOperations = memo(({ well: givenWell, onDone }) => {
|
|||||||
const [wellContext] = useWell()
|
const [wellContext] = useWell()
|
||||||
const well = useMemo(() => givenWell ?? wellContext, [givenWell, wellContext])
|
const well = useMemo(() => givenWell ?? wellContext, [givenWell, wellContext])
|
||||||
|
|
||||||
const url = useMemo(() => `/api/well/${well.id}/wellOperations/import${deleteBeforeImport ? '/1' : '/0'}`, [well])
|
const url = useMemo(() => `/api/well/${well.id}/wellOperations/import/${deleteBeforeImport ? 1 : 0}`, [well, deleteBeforeImport])
|
||||||
|
|
||||||
const onUploadSuccess = useCallback(() => {
|
const onUploadSuccess = useCallback(() => {
|
||||||
setErrorText('')
|
setErrorText('')
|
||||||
|
Loading…
Reference in New Issue
Block a user