Commit 49b2fba4 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v1.0.0_issue610' into 'v1.0.0'

Move POST datasets/{id}/doi to datasets/{id}/action/doi

See merge request !403
parents 994a0359 6ecf9ba1
Pipeline #111983 passed with stages
in 35 minutes and 50 seconds
......@@ -59,7 +59,7 @@ const DatasetActions = React.memo(function VisitDatasetAction({data}) {
}, [api, raiseError, data.dataset_id, refresh])
const handleAssignDoi = useCallback(() => {
api.post(`/datasets/${data.dataset_id}/doi`)
api.post(`/datasets/${data.dataset_id}/action/doi`)
.then(refresh).catch(raiseError)
}, [api, raiseError, data.dataset_id, refresh])
......
......@@ -331,7 +331,7 @@ async def delete_dataset(
@router.post(
'/{dataset_id}/doi', tags=[default_tag],
'/{dataset_id}/action/doi', tags=[default_tag],
summary='Assign a DOI to a dataset',
response_model=DatasetResponse,
responses=create_responses(_bad_id_response, _dataset_is_fixed_response, _bad_user_response),
......
......@@ -195,7 +195,7 @@ def integrationtests(auth: api.Auth, skip_parsers: bool, skip_publish: bool, ski
if not skip_doi and published:
print('assigning a DOI')
response = api.post(f'datasets/{dataset_id}/doi', auth=auth)
response = api.post(f'datasets/{dataset_id}/action/doi', auth=auth)
assert response.status_code == 200, response.text
has_doi = True
......
......@@ -284,7 +284,7 @@ def test_assign_doi_dataset(client, data, test_user, test_user_auth, other_test_
if user == 'other_test_user':
auth = other_test_user_auth
response = client.post(
'datasets/%s/doi' % dataset_id, headers=auth)
'datasets/%s/action/doi' % dataset_id, headers=auth)
assert_response(response, status_code=status_code)
if status_code != 200:
......
......@@ -250,7 +250,7 @@ class TestEditRepo():
datasets=[self.example_dataset.name], query=self.query('upload_1'))
assert rv.status_code == 200
rv = self.api.post('datasets/%s/doi' % self.example_dataset.name, headers=self.test_user_auth)
rv = self.api.post('datasets/%s/action/doi' % self.example_dataset.name, headers=self.test_user_auth)
assert rv.status_code == 200
rv = self.perform_edit(datasets=[], query=self.query('upload_1'))
assert rv.status_code == 400
......
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