Skip to content

Commit

Permalink
restore correct existing apos doc id
Browse files Browse the repository at this point in the history
  • Loading branch information
haroun committed Sep 4, 2024
1 parent 274c153 commit b2ee0bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ test/public/css/master-*.less

# Dont commit test uploads
test/public/uploads
test/data
4 changes: 2 additions & 2 deletions lib/methods/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit b2ee0bf

Please sign in to comment.