simplify add all method

This commit is contained in:
Peter Clement 2022-02-22 15:56:11 +00:00
parent dffdcd882f
commit 8531b9fd40
1 changed files with 1 additions and 9 deletions

View File

@ -222,15 +222,7 @@
} }
if (e.detail) { if (e.detail) {
let rowsToAdd = [] selectedRows = [...selectedRows, ...rows]
rows.map(x =>
selectedRows
.map(y => rows.map(x => x._id).indexOf(y._id))
.includes(true)
? null
: rowsToAdd.push(x)
)
selectedRows = [...selectedRows, ...rowsToAdd]
} else { } else {
//remove every object from selectedRows that is not in rows //remove every object from selectedRows that is not in rows
let filtered = selectedRows.filter(el => let filtered = selectedRows.filter(el =>