Search code examples
react-admin

React-admin no edit on list


Working through a new admin panel with react-admin. Mongo datastore so I have worked through all of the mapping from _id to id and such in the dataProvider. I can go directly to the edit page for a user, but the edit link does not show up on my list view for all users.

Can provide more info if needed. Everything else is working, create button shows up, etc.

EDIT: Actually I figured this part out. I forgot to add the to the datagrid. Now a new problem arises. It does load the edit screen when I click the button, but I get an "Incorrect Element" error at the bottom that I can't quite figure out yet.


Solution

  • I guess I just need to debug more before I go asking questions. I had a bad data mapping in my dataProvider. This fixed it:

          case GET_ONE:
            return {data : { ...json, id: json._id } }
    

    The Incorrect Element was getting thrown because it couldn't find the id field.