i have this object:
and i want to update each student on object, each student is with an unique index (id from database), so i can send that object to the server later, this is how i´ve tried:
studentID = param (integer)
notes = param (object)
the function is call every time i change an input in the form
for (let i = 0; i < this.studentNotes[studentID].desempenos.length; i++) {
if (this.studentNotes[studentID].desempenos[i].desempeno === desempeno) {
this.studentNotes[studentID].desempenos[i].nota = notes.nota;
}
}
The problem is this: I enter the values for the index 190 and it saves, but when i want to save the values for other index, let's say 191, it overrides the value from 190.
i can't figure it out why.
Thanks in advance.