mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-13 01:37:26 +00:00
Merge pull request #2670 from overleaf/em-convert-doc-to-file-rev
Adjust the file rev when converting a doc to a file GitOrigin-RevId: 6765bcac1fcd4f4db35f9ce88af1f201f5da509a
This commit is contained in:
parent
44cb795050
commit
9f3b2d2cdc
2 changed files with 4 additions and 3 deletions
|
@ -1555,7 +1555,7 @@ const ProjectEntityUpdateHandler = {
|
|||
}
|
||||
FileStoreHandler.uploadFileFromDisk(
|
||||
projectId,
|
||||
{ name: doc.name },
|
||||
{ name: doc.name, rev: rev + 1 },
|
||||
fsPath,
|
||||
(err, fileStoreUrl, fileRef) => {
|
||||
if (err) {
|
||||
|
|
|
@ -2073,6 +2073,7 @@ describe('ProjectEntityUpdateHandler', function() {
|
|||
this.tmpFilePath = '/tmp/file'
|
||||
this.fileStoreUrl = 'http://filestore/file'
|
||||
this.folder = { _id: new ObjectId() }
|
||||
this.rev = 3
|
||||
this.ProjectLocator.findElement
|
||||
.withArgs({
|
||||
project_id: this.project._id,
|
||||
|
@ -2089,7 +2090,7 @@ describe('ProjectEntityUpdateHandler', function() {
|
|||
.yields(null, this.file, this.docPath, this.folder)
|
||||
this.DocstoreManager.getDoc
|
||||
.withArgs(this.project._id, this.doc._id)
|
||||
.yields(null, this.docLines)
|
||||
.yields(null, this.docLines, this.rev)
|
||||
this.FileWriter.writeLinesToDisk.yields(null, this.tmpFilePath)
|
||||
this.FileStoreHandler.uploadFileFromDisk.yields(
|
||||
null,
|
||||
|
@ -2124,7 +2125,7 @@ describe('ProjectEntityUpdateHandler', function() {
|
|||
this.FileStoreHandler.uploadFileFromDisk
|
||||
).to.have.been.calledWith(
|
||||
this.project._id,
|
||||
{ name: this.doc.name },
|
||||
{ name: this.doc.name, rev: this.rev + 1 },
|
||||
this.tmpFilePath
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue