I have a Object named objectX like this
{
"test": [
{
"id": "de6b4d1c-6e04-46a1-908b-9ed5c78e1boc",
},
{
"id": "de6b4d1c-6e04-46a1-908b-9ed5c78e1boc",
},
{
"id": "de6b4d1c-6e04-46a1-908b-9ed5c78e1boc",
},
{
"id": "de6b4d1c-6e04-46a1-908b-9ed5c78e1boc",
},
{
"id": "de6b4d1c-6e04-46a1-908b-9ed5c78e1boc",
},
{
"id": "de6b4d1c-6e04-46a1-908b-9ed5c78e1boc",
}
],
}
and i want to update the id for all my objects in my test array.
To do that, i was doing
objectX.test.forEach((obj) => {
obj.id = newId
})
But with my forEach, i have this
Error: "[vuex] do not mutate vuex store state outside mutation handlers."
Anyone know how can i update my ids without getting error like this ?