Merge pull request #9563 from overleaf/em-tpds-merge-metadata

Return metadata from TPDS update endpoint in web

GitOrigin-RevId: 9154be67f7f975807c6e986a5d6fb66013c9a384
This commit is contained in:
Eric Mc Sween
2022-09-12 15:59:16 +01:00
committed by Copybot
parent ceb000eb2b
commit 19c73cbd73
13 changed files with 236 additions and 200 deletions

View File

@@ -43,6 +43,7 @@ module.exports = {
'project',
'path',
'newProject',
'newFileRef',
]),
replaceDocWithFile: callbackify(replaceDocWithFile),
replaceFileWithDoc: callbackify(replaceFileWithDoc),
@@ -188,7 +189,9 @@ async function replaceFileWithNew(projectId, fileId, newFileRef) {
path,
})
}
return { oldFileRef: fileRef, project, path, newProject }
// Refresh newFileRef with the version returned from the database
newFileRef = ProjectLocator.findElementByMongoPath(newProject, path.mongo)
return { oldFileRef: fileRef, project, path, newProject, newFileRef }
}
async function replaceDocWithFile(projectId, docId, fileRef) {