mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-22 02:04:31 +00:00
Merge pull request #14870 from overleaf/bg-async-await-linked-files-handler
add exported promises to linked files handler GitOrigin-RevId: 43570f7e93240c3b5901eecb28325930f2b8fb05
This commit is contained in:
parent
67ec78f7c6
commit
2394a32858
1 changed files with 9 additions and 2 deletions
|
@ -10,7 +10,6 @@
|
|||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
let LinkedFilesHandler
|
||||
const FileWriter = require('../../infrastructure/FileWriter')
|
||||
const EditorController = require('../Editor/EditorController')
|
||||
const ProjectLocator = require('../Project/ProjectLocator')
|
||||
|
@ -22,8 +21,9 @@ const {
|
|||
V1ProjectNotFoundError,
|
||||
BadDataError,
|
||||
} = require('./LinkedFilesErrors')
|
||||
const { promisifyAll } = require('../../util/promises')
|
||||
|
||||
module.exports = LinkedFilesHandler = {
|
||||
const LinkedFilesHandler = {
|
||||
getFileById(projectId, fileId, callback) {
|
||||
if (callback == null) {
|
||||
callback = function () {}
|
||||
|
@ -151,3 +151,10 @@ module.exports = LinkedFilesHandler = {
|
|||
})
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
...LinkedFilesHandler,
|
||||
promises: promisifyAll(LinkedFilesHandler, {
|
||||
multiResult: { getFileById: ['file', 'path', 'parentFolder'] },
|
||||
}),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue