Why when I insert objects into an array, they are inserted and overwritten in the first method
but in the second nothing happens?
el:"#usersList",
data () {
return {
users: []
}
},
This works
.then(response => (this.users = response.data))
Why this does not work?
.then(
function (response) {
var arr = response.data;
const rename = null;
arr.forEach( function(data) {
switch(data["prava"]) {
case "1":
data["prava"] = "User 0";
break;
case "2":
data["prava"] = "User 1";
break;
case "3":
data["prava"] = "Mod";
break;
case "4":
data["prava"] = "Admin";
break;
case "5":
data["prava"] = "Owner";
break;
default:
data["prava"] = "User 1";
}
});
this.users = arr;
})