Skip to content
Permalink
Browse files

fix(form): fix removing of table rows

  • Loading branch information...
anehx committed Jul 24, 2019
1 parent df6a6e6 commit 5ea78819d027c0f5bc86a685f02c62d221655b89
Showing with 2 additions and 2 deletions.
  1. +2 −2 addon/components/cf-field/input/table.js
@@ -56,7 +56,7 @@ export default Component.extend(ComponentQueryManager, {
if (!this.field.answer.value) return;

const remainingDocuments = this.field.answer.value.filter(
doc => doc.id !== document.id
doc => doc.pk !== document.pk
);

yield this.onSave(remainingDocuments);
@@ -73,7 +73,7 @@ export default Component.extend(ComponentQueryManager, {

const rows = this.get("field.answer.value") || [];

if (!rows.find(doc => doc.uuid === newDocument.uuid)) {
if (!rows.find(doc => doc.pk === newDocument.pk)) {
// add document to table
yield this.onSave([...rows, newDocument]);

0 comments on commit 5ea7881

Please sign in to comment.
You can’t perform that action at this time.