I have this object
{
"alunos": [
{
"aluno": {
"id": 1,
"nome": "Genevieve Sipes",
"status": "Ativo"
},
"mensalidade": {
"status": "Débito"
}
},
{
"aluno": {
"id": 2,
"nome": "Greyson Herman",
"status": "Ativo"
},
"mensalidade": {
"status": "Débito"
}
},
{
"aluno": {
"id": 3,
"nome": "Yessenia Emmerich",
"status": "Ativo"
},
"mensalidade": {
"status": "Débito"
}
},]
}
I need to turn it into something like this
[
{
nome: 'Genevieve Sipes',
status: 'Débito',
},
]
I tried to do this, but it did not work, does anyone know how to do it?
this.names = this.students.map(function(student){
console.log(student.aluno.nome);
return student.aluno.nome;
})