I am trying to get data from a firebase database. I am getting the Object structure this way:
I want to be made this way:
Is there any elegant way of doing this in the frontend or is it better to make the changes in the tree structure in the database?
The only reason I have it in the current form, is that it makes it easier for me to form a tree hierarchy structure later on.

