Commit b5596f5c authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'master' into 'v1.0.6'

Merge latest released changes.

See merge request !600
parents a9105a2b 535d0c11
Pipeline #126867 passed with stages
in 30 minutes and 47 seconds
......@@ -44,7 +44,7 @@ export default function ResolveDOI() {
})
let { doi } = doiMatch.params
api.get('/datasets', {doi: doi})
api.get('/datasets/', {doi: doi})
.then(response => {
if (response.pagination.total >= 1) {
const dataset_id = response.data[0].dataset_id
......
......@@ -338,7 +338,7 @@ function EditMetaDataDialog({...props}) {
}, [])
const createNewDatasets = useCallback(() => {
const promises = actions.filter(action => action.create_dataset).map(action => api.post(`/datasets`, {dataset_name: action.create_dataset}))
const promises = actions.filter(action => action.create_dataset).map(action => api.post(`/datasets/`, {dataset_name: action.create_dataset}))
return Promise.all(promises)
}, [api, actions])
......
......@@ -355,6 +355,7 @@ function UploadPage() {
})
.catch((error) => {
if (error instanceof DoesNotExist && deleteClicked) {
history.push(getUrl('uploads', location))
return
}
if (!hasUpload && error.apiMessage) {
......@@ -363,17 +364,15 @@ function UploadPage() {
raiseError(error)
}
})
}, [api, hasUpload, uploadId, pagination, deleteClicked, raiseError, setData, setApiData])
}, [api, hasUpload, uploadId, pagination, deleteClicked, raiseError, setData, setApiData, location, history])
// constant fetching of upload data when necessary
useEffect(() => {
if (isProcessing) {
const interval = setInterval(fetchData(), 1000)
return () => clearInterval(interval)
} else if (deleteClicked) {
history.push(getUrl('uploads', location))
}
}, [fetchData, isProcessing, deleteClicked, history, location])
}, [fetchData, isProcessing])
// initial fetching of upload data
useEffect(fetchData(), [fetchData])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment