diff --git a/.gitignore b/.gitignore index 0fdf3a3f..5dbfe1ad 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ test/public/css/master-*.less # Dont commit test uploads test/public/uploads +test/data diff --git a/lib/methods/import.js b/lib/methods/import.js index 071efb4b..faa773a0 100644 --- a/lib/methods/import.js +++ b/lib/methods/import.js @@ -820,9 +820,9 @@ module.exports = self => { } } - const existingAposDocId = duplicatedDocs + const [ existingAposDocId ] = duplicatedDocs .filter(({ aposDocId }) => aposDocId === doc.aposDocId) - .map(({ replaceId }) => replaceId); + .map(({ replaceId }) => replaceId || null); await self.insertOrUpdateDoc(req, { doc, method: 'update', diff --git a/test/index.js b/test/index.js index d1389c05..651209c3 100644 --- a/test/index.js +++ b/test/index.js @@ -49,6 +49,7 @@ describe('@apostrophecms/import-export', function () { exportsPath = path.join(apos.rootDir, 'public/uploads/exports'); importExportManager = apos.modules['@apostrophecms/import-export']; importExportManager.removeFromUploadFs = () => {}; + importExportManager.remove = () => {}; gzip = importExportManager.formats.gzip; mimeType = gzip.allowedTypes[0];