I hava an array vehicles which has an array within call Photos. For example:
[
{
"id": 251,
"make": "Toyota",
"model": "Land Cruiser ",
"photos": [
{
"id": 7,
"photoUrl": "https://.../1607009083.jpg",
}
]
},
{
"id": 264,
"make": "Toyota",
"model": "Land Cruiser II ",
"photos": [
{
"id": 9,
"photoUrl": "https://.../1607005508.jpg",
}
]
}
]
If I upload a new photo I need to update the array. I know the vehicleId, photoId and photoUrl. Pushing onto the array I get an error:
this.vehicles[vehicleId].photos.push({id: photoId, photoUrl: photoUrl})
Where am I going wrong?