Skip to content

Commit

Permalink
fix: don't set empty values
Browse files Browse the repository at this point in the history
  • Loading branch information
18alantom committed Feb 25, 2022
1 parent e9b52c8 commit eade577
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/dataImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ export class Importer {
}
}

// return docObjs;
return Object.keys(docMap).map((k) => docMap[k]);
}

Expand All @@ -363,8 +362,15 @@ export class Importer {
delete docObj.name;
}

const doc = frappe.getNewDoc(this.doctype);
for (const key in docObj) {
if (docObj[key] !== '') {
continue;
}

delete docObj[key];
}

const doc = frappe.getNewDoc(this.doctype);
try {
await doc.set(docObj);
await doc.insert();
Expand Down

0 comments on commit eade577

Please sign in to comment.