mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 12:51:35 +02:00
Merge pull request #9658 from overleaf/em-dropbox-folder-sync
Sync folder creation from Dropbox to Overleaf GitOrigin-RevId: a2749ab8d9db7dd312818b46d6e72f1dbaaaff2e
This commit is contained in:
@@ -50,6 +50,7 @@ module.exports = {
|
||||
mkdirp: callbackifyMultiResult(wrapWithLock(mkdirp), [
|
||||
'newFolders',
|
||||
'folder',
|
||||
'parentFolder',
|
||||
]),
|
||||
moveEntity: callbackifyMultiResult(wrapWithLock(moveEntity), [
|
||||
'project',
|
||||
@@ -279,13 +280,14 @@ async function mkdirp(projectId, path, options = {}) {
|
||||
for (const folderName of folders) {
|
||||
builtUpPath += `/${folderName}`
|
||||
try {
|
||||
const { element: foundFolder } =
|
||||
const { element: foundFolder, folder: parentFolder } =
|
||||
await ProjectLocator.promises.findElementByPath({
|
||||
project,
|
||||
path: builtUpPath,
|
||||
exactCaseMatch: options.exactCaseMatch,
|
||||
})
|
||||
lastFolder = foundFolder
|
||||
lastFolder.parentFolder_id = parentFolder._id
|
||||
} catch (err) {
|
||||
// Folder couldn't be found. Create it.
|
||||
const parentFolderId = lastFolder && lastFolder._id
|
||||
|
||||
Reference in New Issue
Block a user