mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
return url from FileStoreHandler.copyFile
This commit is contained in:
parent
4ec0d07aae
commit
60ee78704a
2 changed files with 6 additions and 1 deletions
|
@ -92,7 +92,7 @@ module.exports = FileStoreHandler =
|
||||||
request opts, (err)->
|
request opts, (err)->
|
||||||
if err?
|
if err?
|
||||||
logger.err err:err, oldProject_id:oldProject_id, oldFile_id:oldFile_id, newProject_id:newProject_id, newFile_id:newFile_id, "something went wrong telling filestore api to copy file"
|
logger.err err:err, oldProject_id:oldProject_id, oldFile_id:oldFile_id, newProject_id:newProject_id, newFile_id:newFile_id, "something went wrong telling filestore api to copy file"
|
||||||
callback(err)
|
callback(err, opts.uri)
|
||||||
|
|
||||||
_buildUrl: (project_id, file_id)->
|
_buildUrl: (project_id, file_id)->
|
||||||
return "#{settings.apis.filestore.url}/project/#{project_id}/file/#{file_id}"
|
return "#{settings.apis.filestore.url}/project/#{project_id}/file/#{file_id}"
|
||||||
|
|
|
@ -219,6 +219,11 @@ describe "FileStoreHandler", ->
|
||||||
@handler._buildUrl.calledWith(@newProject_id, @newFile_id).should.equal true
|
@handler._buildUrl.calledWith(@newProject_id, @newFile_id).should.equal true
|
||||||
done()
|
done()
|
||||||
|
|
||||||
|
it "returns the url", (done)->
|
||||||
|
@request.callsArgWith(1, null)
|
||||||
|
@handler.copyFile @project_id, @file_id, @newProject_id, @newFile_id, (err, url) =>
|
||||||
|
url.should.equal "http://filestore.stubbedBuilder.com"
|
||||||
|
done()
|
||||||
|
|
||||||
it "should return the err", (done)->
|
it "should return the err", (done)->
|
||||||
error = "errrror"
|
error = "errrror"
|
||||||
|
|
Loading…
Reference in a new issue