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

modal: fix record adding to a community #2822

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

jrcastro2
Copy link
Contributor

Copy link
Member

@alejandromumo alejandromumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment.

I checked that the only place where data is used is like data.processed[0].request. So this change should be OK (no need to serialize the response to anything more complex)

// no nee to process the response with the schema serializer
const response = await http.post(recordCommunityEndpoint, data, {
headers: {
"Accept": "application/json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be the other way around and fix the endpoint to accept the inveniordm.json+vnd? @slint

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am jumping in since I might have a bit more context. (However anyone is welcomed to comment!)

The endpoint currently accepts the inveniordm.json+vnd content type. However, it is part of a resource that utilizes a serializer with a schema expecting a standard community dictionary object. Since we are passing a custom dictionary structure instead, the schema validation fails when using our custom Accept header. As a result, we have decided to disable this header in both the backend and frontend for this endpoint.

@jrcastro2 jrcastro2 merged commit 56893c6 into inveniosoftware:master Sep 3, 2024
4 checks passed
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.

Bug on adding a record to a community
3 participants