marklogic-community / grove

Grove, a toolkit full of tooling, templates, and other resources that help with building UI applications on top of MarkLogic.
https://marklogic-community.github.io/grove/
Other
5 stars 2 forks source link

Response.content in Redux CRUD actions may cause conflicts with some data #42

Open freeweel opened 4 years ago

freeweel commented 4 years ago

I used the getDoc() method in /ui/src/redux/crud/actions/index.js

In line 37 of the code (v2.0.1 per the pkg.json):

return { content: response.content || response, ... }

It just so happened that the data I was trying to return from the transform had a .content field as the first child. So I always got the child data instead of the root that I was expecting. Took me quite a while to figure out why this was happening.

I don't know the use case for response.content, but it does create a problem if your data has a root.content

Paul Vanderveen (paul.vanderveen@marklogic.com