I have this json [{"id":1,"id_pai":null,"id_usuario":1,"ordem":1,"lado":"1"},[{"id":2,"id_pai":1,"id_usuario":2,"ordem":1,"lado":"1"},{"id":3,"id_pai":1,"id_usuario":3,"ordem":2,"lado":"2"}],[{"id":4,"id_pai":2,"id_usuario":4,"ordem":1,"lado":"1"}],[{"id":2,"id_pai":1,"id_usuario":2,"ordem":1,"lado":"1"},{"id":3,"id_pai":1,"id_usuario":3,"ordem":2,"lado":"2"}]]
I need to go through and transform that, in that, the missing data, I'll add later.
{ id: 0, parent: null, description: "Nivel do Peão", email: "[email protected]", groupTitleColor: "#4169e1", image: "demo/images/photos/q.png", itemTitleColor: "#4169e1", phone: "(19) 98111-9983", title: "Nome do Peão", label: "Nome do Peão" }
How do I route it with javascript?
Question 2, how do I avoid duplicate items?