Records management API: Filtering in the hierarchy doesn't return subnodes of the found node
When filtering the nodes (see upload_hierarchy in https://gitlab.labs.nic.cz/labs/qdatovka/wikis/records-management-api) in order to send data message to an external service, the filtering does not work as expected.
Problem is, user generally knows the name of a node, but wants to attach the message to a subnode. When filtering using name of node, the app is not returning the subnodes of the found node (just the node itself).
--
Example: there is a client (i.e. node) named Iva Fišerová with records (i.e. subnodes) named Právní poradenství, Spor o 400.000,- s Alenou Holaňovou etc.. Client is searching using the name of the client (Česká pojištovna), but then expects the app to show him all the subnodes (records where he can actually upload data messaged.
In the example below, when searching for Prvni Klient, I should get all Prvni klient, Prvni spis, Druhy spis nodes. I am now getting just Prvni Klient.
{ "name": null, "id": null, "metadata": [], "sub": [ { "name": "Prvni Klient", "id": null, "metadata": ["jednicka", "12582"], "sub": [ { "name": "Prvni spis", "id": "af51ef52yx", "metadata": ["jednicka", "v supliku"], "sub": [] }, { "name": "Druhy spis", "id": "af51ef52yz", "metadata": ["jednicka", "taky v supliku"], "sub": [] } ] }, { "name": "Druhy Klient", "id": null, "metadata": ["jednicka", "12582"], "sub": [ { "name": "Dalsi spis", "id": "aabbccddee", "metadata": [], "sub": [] } ] } ] }