mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix ProjectEntityHandler.getAllEntities callback in _findExistingFileType (#9108)
GitOrigin-RevId: fe29488b44fa5e738c23f2939297057fb2832758
This commit is contained in:
parent
36fae7c8ea
commit
19db9c2583
3 changed files with 5 additions and 3 deletions
|
@ -232,7 +232,6 @@ module.exports = ProjectEntityHandler
|
|||
module.exports.promises = promisifyAll(ProjectEntityHandler, {
|
||||
without: ['getAllEntitiesFromProject'],
|
||||
multiResult: {
|
||||
getAllEntities: ['docs', 'files'],
|
||||
getDoc: ['lines', 'rev', 'version', 'ranges'],
|
||||
},
|
||||
})
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue