I have a json that I'm running through json-server and it's at: link
Within it, it has a scope of "users", which I would like to take.
I have the following script I put together, it follows:
$.getJSON(urlParam, function (data) {
let itens = []
$.each( data, function (key, val) {
itens.push( {key, val} )
})
return itens
})
I would like to get both a user list, which is converted to json, both a user only.
Follow my json:
{
"alunos": [
{
"id": 1,
"nome": "Thiago Cunha"
},
{
"id": 2,
"nome": "Caroline Cunha"
},
{
"id": 3,
"nome": "Thalita Cunha"
}
],
"users": [
{
"id": 1,
"nome": "Thiago Cunha",
"img": "dist/images/thiago.jpg",
"status": true
},
{
"id": 2,
"nome": "Caroline Cunha",
"img": "dist/images/thiago.jpg",
"status": true
},
{
"id": 3,
"nome": "Thalita Cunha",
"img": "dist/images/thiago.jpg",
"status": true
}
]
}
Can anyone help me please?