Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added helpers for making api calls #258

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Conversation

Ducica
Copy link
Contributor

@Ducica Ducica commented Nov 25, 2024

We were using http helper from react-invenio-forms, to make API calls (https://github.com/inveniosoftware/react-invenio-forms/blob/f6ac055fc704c744561687c8a2f77925abd0ecd4/src/lib/api/connector.js#L22)

Currently, (v4 of react-invenio-forms), it is calling to VND api, but we are still on v3 in which it used to call to application-json.

Unfortunately, due to various reasons, we have inconsistencies on our end as well (some apis dont work, or don't work fully with vnd accept header), so therefore (currently specifically in oarepo-requests, but probably elsewhere as well), we sometimes need to call to application/json and sometimes to vnd. So I thought for safety to simply create two helpers and put them in our code, so we don't get a situation where dependencies upgrade and we end up with broken code. Of course, if we ever manage to get to a point where we can just use vnd header everywhere, we could just delete these and go back to react-invenio-forms helper (which generally I feel is a convenient little abstraction).

@Ducica Ducica requested a review from mirekys November 25, 2024 20:24
@Ducica Ducica marked this pull request as ready for review November 25, 2024 20:24
@mirekys mirekys merged commit 67ba9f5 into main Nov 27, 2024
3 checks passed
@mirekys mirekys deleted the helpers-for-async-requests branch November 27, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants