I have a table with data:
When i click on remove button I know index and userID who have this data.
I would like to remove this object from "timeRecords" array and return "employeeList" without it.
I tried implemented this function, but without result
//recordId = index and key also, userID = userId who have this records.
deleteRecord = (recordID, userID) => {
console.log(`usunięto rekord: ${recordID}, na użytkowniku o ID: ${userID}`);
let employeesList = this.state.employeesList;
employeesList = employeesList.filter(el => {
if (el.id === userID) {
if (el.timeRecords !== recordID) {
return el.timeRecords;
}
}
});
};
