Skip to content

Commit

Permalink
http headers: use and adjust vnd.inveniordm.v1+json http accept header
Browse files Browse the repository at this point in the history
  • Loading branch information
anikachurilova committed Jan 30, 2024
1 parent de9dd60 commit 629ecb9
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 26 deletions.
4 changes: 2 additions & 2 deletions invenio_app_rdm/records_ui/searchapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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"},
),
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ export default class RemovalReasonsSelect extends Component {
this.setState({ loading: true });
const url = "/api/vocabularies/removalreasons";
this.cancellableAction = withCancel(

Check failure on line 37 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/RemovalReasonsSelect.js

View workflow job for this annotation

GitHub Actions / Tests (3.8, pypi, postgresql13, opensearch2, 14.x)

Replace `⏎······http.get(url)⏎····` with `http.get(url)`

Check failure on line 37 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/RemovalReasonsSelect.js

View workflow job for this annotation

GitHub Actions / Tests (3.8, pypi, postgresql13, elasticsearch7, 14.x)

Replace `⏎······http.get(url)⏎····` with `http.get(url)`

Check failure on line 37 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/RemovalReasonsSelect.js

View workflow job for this annotation

GitHub Actions / Tests (3.9, pypi, postgresql13, opensearch2, 14.x)

Replace `⏎······http.get(url)⏎····` with `http.get(url)`

Check failure on line 37 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/RemovalReasonsSelect.js

View workflow job for this annotation

GitHub Actions / Tests (3.9, pypi, postgresql13, elasticsearch7, 14.x)

Replace `⏎······http.get(url)⏎····` with `http.get(url)`
http.get(url, {
headers: {
Accept: "application/vnd.inveniordm.v1+json",
},
})
http.get(url)
);
try {
const response = await this.cancellableAction.promise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ export class RecordsList extends Component {
this.setState({ isLoading: true });

this.cancellableFetch = withCancel(

Check failure on line 48 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/frontpage/RecordsList.js

View workflow job for this annotation

GitHub Actions / Tests (3.8, pypi, postgresql13, opensearch2, 14.x)

Replace `⏎······http.get(fetchUrl)⏎····` with `http.get(fetchUrl)`

Check failure on line 48 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/frontpage/RecordsList.js

View workflow job for this annotation

GitHub Actions / Tests (3.8, pypi, postgresql13, elasticsearch7, 14.x)

Replace `⏎······http.get(fetchUrl)⏎····` with `http.get(fetchUrl)`

Check failure on line 48 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/frontpage/RecordsList.js

View workflow job for this annotation

GitHub Actions / Tests (3.9, pypi, postgresql13, opensearch2, 14.x)

Replace `⏎······http.get(fetchUrl)⏎····` with `http.get(fetchUrl)`

Check failure on line 48 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/frontpage/RecordsList.js

View workflow job for this annotation

GitHub Actions / Tests (3.9, pypi, postgresql13, elasticsearch7, 14.x)

Replace `⏎······http.get(fetchUrl)⏎····` with `http.get(fetchUrl)`
http.get(fetchUrl, {
headers: {
Accept: "application/vnd.inveniordm.v1+json",
},
})
http.get(fetchUrl)
);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const EditButton = ({ recid, onError }) => {
{
headers: {
"Content-Type": "application/json",
"Accept": "application/vnd.inveniordm.v1+json",
},
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, }

Check failure on line 92 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js

View workflow job for this annotation

GitHub Actions / Tests (3.8, pypi, postgresql13, opensearch2, 14.x)

Delete `,`

Check failure on line 92 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js

View workflow job for this annotation

GitHub Actions / Tests (3.8, pypi, postgresql13, elasticsearch7, 14.x)

Delete `,`

Check failure on line 92 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js

View workflow job for this annotation

GitHub Actions / Tests (3.9, pypi, postgresql13, opensearch2, 14.x)

Delete `,`

Check failure on line 92 in invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js

View workflow job for this annotation

GitHub Actions / Tests (3.9, pypi, postgresql13, elasticsearch7, 14.x)

Delete `,`
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export const RDMRecordResultsListItem = ({ result }) => {
{
headers: {
"Content-Type": "application/json",
"Accept": "application/vnd.inveniordm.v1+json",
},
}
)
Expand Down
2 changes: 1 addition & 1 deletion invenio_app_rdm/users_ui/searchapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]],
),
Expand Down

0 comments on commit 629ecb9

Please sign in to comment.