From 19db9c258348e81fdb88eb32a3bf6a7f65e48f31 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Tue, 9 Aug 2022 14:52:43 +0100 Subject: [PATCH] Fix ProjectEntityHandler.getAllEntities callback in _findExistingFileType (#9108) GitOrigin-RevId: fe29488b44fa5e738c23f2939297057fb2832758 --- .../web/app/src/Features/Project/ProjectEntityHandler.js | 1 - .../web/app/src/Features/ThirdPartyDataStore/UpdateMerger.js | 2 +- .../test/unit/src/ThirdPartyDataStore/UpdateMergerTests.js | 5 ++++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectEntityHandler.js b/services/web/app/src/Features/Project/ProjectEntityHandler.js index 2d76e27d48..304681a4de 100644 --- a/services/web/app/src/Features/Project/ProjectEntityHandler.js +++ b/services/web/app/src/Features/Project/ProjectEntityHandler.js @@ -232,7 +232,6 @@ module.exports = ProjectEntityHandler module.exports.promises = promisifyAll(ProjectEntityHandler, { without: ['getAllEntitiesFromProject'], multiResult: { - getAllEntities: ['docs', 'files'], getDoc: ['lines', 'rev', 'version', 'ranges'], }, }) diff --git a/services/web/app/src/Features/ThirdPartyDataStore/UpdateMerger.js b/services/web/app/src/Features/ThirdPartyDataStore/UpdateMerger.js index 05d3f35a06..5aa2589870 100644 --- a/services/web/app/src/Features/ThirdPartyDataStore/UpdateMerger.js +++ b/services/web/app/src/Features/ThirdPartyDataStore/UpdateMerger.js @@ -55,7 +55,7 @@ module.exports = UpdateMerger = { _findExistingFileType(project_id, path, callback) { ProjectEntityHandler.getAllEntities( project_id, - function (err, docs, files) { + function (err, { docs, files }) { if (err != null) { return callback(err) } diff --git a/services/web/test/unit/src/ThirdPartyDataStore/UpdateMergerTests.js b/services/web/test/unit/src/ThirdPartyDataStore/UpdateMergerTests.js index aad0b4a732..02979a9d64 100644 --- a/services/web/test/unit/src/ThirdPartyDataStore/UpdateMergerTests.js +++ b/services/web/test/unit/src/ThirdPartyDataStore/UpdateMergerTests.js @@ -33,7 +33,10 @@ describe('UpdateMerger :', function () { this.existingFiles = [{ path: '/figure.pdf' }, { path: '/folder/fig1.pdf' }] this.ProjectEntityHandler.getAllEntities = sinon .stub() - .callsArgWith(1, null, this.existingDocs, this.existingFiles) + .callsArgWith(1, null, { + docs: this.existingDocs, + files: this.existingFiles, + }) this.fsPath = '/tmp/file/path' this.source = 'dropbox'