When moving multiple nodes into a new parent requesting items to be added using index -1 the moved nodes end up in reversed order. The expected behavior is that the order would be preserved.
Starting from document
* from
* 1
* 2
* to
and then issuing a POST https://dynalist.io/api/v1/doc/edit
request with payload
{
"token": "...",
"file_id": "...",
"changes": [
{
"action": "move",
"node_id": "<id for '1'>",
"parent_id": "<id for 'to'>",
"index": -1
},
{
"action": "move",
"node_id": "<id for '2'>",
"parent_id": "<id for 'to'>",
"index": -1
}
]
}
the result is
* from
* to
* 2
* 1
where the order 1, 2 of source nodes is reversed in the destination.