I am struggling to properly store my 'players' data within my team data structure. Currently, it is being saved with the team id but I need it to be nested inside of teams.
Essentially, I want the players to seamlessly integrate and be appended onto the existing 'players' array...
https://i.sstatic.net/dq8pe.png
This is the code snippet from my VUEX store that pushes the data to firebase:
firebase
.database()
.ref('teams/')
.child(payload.id)
.push(player)
.then(user => {
commit('updatePlayers', {
players: payload.players
});
})
.catch(error => {
console.log(error);
});
// Communicate with firebase and store the data
},