diff --git a/invenio_app_rdm/records_ui/searchapp.py b/invenio_app_rdm/records_ui/searchapp.py index ce0f19a80..3b35f32b0 100644 --- a/invenio_app_rdm/records_ui/searchapp.py +++ b/invenio_app_rdm/records_ui/searchapp.py @@ -31,7 +31,7 @@ def search_app_context(): config_name="RDM_SEARCH_USER_REQUESTS", available_facets=current_app.config["REQUESTS_FACETS"], sort_options=current_app.config["RDM_SORT_OPTIONS"], - headers={"Accept": "application/json"}, + headers={"Accept": "application/vnd.inveniordm.v1+json"}, hidden_params=[ ["expand", "1"], ["is_open", "true"], @@ -65,6 +65,6 @@ def search_app_context(): config_name="RDM_SEARCH", available_facets=current_app.config["RDM_FACETS"], sort_options=current_app.config["RDM_SORT_OPTIONS"], - headers={"Accept": "application/json"}, + headers={"Accept": "application/vnd.inveniordm.v1+json"}, ), } diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/RemovalReasonsSelect.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/RemovalReasonsSelect.js index 3eac9aef4..83b889219 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/RemovalReasonsSelect.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/RemovalReasonsSelect.js @@ -34,13 +34,8 @@ export default class RemovalReasonsSelect extends Component { const { setFieldValue } = this.props; this.setState({ loading: true }); const url = "/api/vocabularies/removalreasons"; - this.cancellableAction = withCancel( - http.get(url, { - headers: { - Accept: "application/vnd.inveniordm.v1+json", - }, - }) - ); + this.cancellableAction = withCancel(http.get(url)); + try { const response = await this.cancellableAction.promise; const options = response.data.hits.hits; diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/frontpage/RecordsList.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/frontpage/RecordsList.js index ee0a02cf3..092561c2e 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/frontpage/RecordsList.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/frontpage/RecordsList.js @@ -45,13 +45,7 @@ export class RecordsList extends Component { const { fetchUrl } = this.props; this.setState({ isLoading: true }); - this.cancellableFetch = withCancel( - http.get(fetchUrl, { - headers: { - Accept: "application/vnd.inveniordm.v1+json", - }, - }) - ); + this.cancellableFetch = withCancel(http.get(fetchUrl)); try { const response = await this.cancellableFetch.promise; diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/CommunitiesManagement.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/CommunitiesManagement.js index 1c223ba5a..f04ab6e22 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/CommunitiesManagement.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/CommunitiesManagement.js @@ -45,11 +45,7 @@ export class CommunitiesManagement extends Component { fetchRecordCommunities = async () => { const { recordCommunityEndpoint } = this.props; - return await http.get(recordCommunityEndpoint, { - headers: { - Accept: "application/vnd.inveniordm.v1+json", - }, - }); + return await http.get(recordCommunityEndpoint); }; getCommunities = async () => { diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/EditButton.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/EditButton.js index 592518269..79168bdf5 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/EditButton.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/EditButton.js @@ -23,7 +23,6 @@ export const EditButton = ({ recid, onError }) => { { headers: { "Content-Type": "application/json", - "Accept": "application/vnd.inveniordm.v1+json", }, } ); diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js index 70738d9ff..009b92bde 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js @@ -89,12 +89,7 @@ export const RecordVersionsList = ({ record, isPreview }) => { const fetchVersions = async () => { return await http.get( `${recordDeserialized.links.versions}?size=${NUMBER_OF_VERSIONS}&sort=version&allversions=true`, - { - headers: { - Accept: "application/vnd.inveniordm.v1+json", - }, - withCredentials: true, - } + { withCredentials: true } ); }; diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads.js index c8c368c35..8455185c9 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads.js @@ -49,7 +49,6 @@ export const RDMRecordResultsListItem = ({ result }) => { { headers: { "Content-Type": "application/json", - "Accept": "application/vnd.inveniordm.v1+json", }, } ) diff --git a/invenio_app_rdm/users_ui/searchapp.py b/invenio_app_rdm/users_ui/searchapp.py index c38d32886..24e3c1374 100644 --- a/invenio_app_rdm/users_ui/searchapp.py +++ b/invenio_app_rdm/users_ui/searchapp.py @@ -40,7 +40,7 @@ def search_app_context(): current_app.config["REQUESTS_FACETS"], current_app.config["RDM_SORT_OPTIONS"], "/api/user/requests", - {"Accept": "application/json"}, + {"Accept": "application/vnd.inveniordm.v1+json"}, initial_filters=[["is_open", "true"]], hidden_params=[["expand", "1"]], ),