[4.1] [API] index_template impossible to create node ONLY from the API
Dear all, The title is not misleading.
Description
- In order to create a node, its parent must be passed.
- When a new index is created, its root node is created as well.
- There is no API endpoint which provides the ID of the Root node.
- It is not possible to create nodes only from the API.
Steps to reproduce
- Run a Mayan EDMS 4.1 instance
- Navigate to the
index_templates
endpoint :/api/v4/index_templates/
- Use the form to create an
index_template
- Notice that there is no mention of the
Root node
ID in theindex_template
- Opening the detail view of the
index_instance
for thisindex_template
also doesn't provide withRoot node
ID - Follow the link to its nodes:
"nodes_url": "..../api/v4/index_templates/23/nodes/"
- Notice that the list is empty
- Use the JSON form to create a node (the HTML form provides a list of nodes including roots, built internally)
- Receive an error for the empty parent
In order to enable creation of nodes solely through the API, one must be able to find the ID of the `Root node`. Expected Behavior (one of many)
- Display the
Root node
ID in theAPIIndexTemplateListView
- Display the
Root node
ID in theAPIIndexTemplateDetailView
- Add an API view to get the
Root node
Edited by Ludovic Anterieur