mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
added /deactivate and /reactivate endpoints as web will call those
also fixed acceptence test
This commit is contained in:
parent
599b9770f4
commit
5765b59e0c
3 changed files with 12 additions and 3 deletions
|
@ -22,6 +22,11 @@ app.get '/project/:project_id/doc/:doc_id/raw', HttpController.getRawDoc
|
|||
app.post '/project/:project_id/doc/:doc_id', bodyParser.json(limit: "2mb"), HttpController.updateDoc
|
||||
app.del '/project/:project_id/doc/:doc_id', HttpController.deleteDoc
|
||||
|
||||
|
||||
app.post '/project/:project_id/deactivate', HttpController.archiveAllDocs
|
||||
app.post '/project/:project_id/reactivate', HttpController.unArchiveAllDocs
|
||||
|
||||
# can delete these two soon
|
||||
app.post '/project/:project_id/archive', HttpController.archiveAllDocs
|
||||
app.post '/project/:project_id/unarchive', HttpController.unArchiveAllDocs
|
||||
|
||||
|
|
|
@ -108,7 +108,6 @@ describe "Archiving all docs", ->
|
|||
@timeout 1000 * 30
|
||||
quarterMegInBytes = 250000
|
||||
lines = require("crypto").randomBytes(quarterMegInBytes).toString("hex")
|
||||
console.log @project_id, @docs[1]._id, "helllllo"
|
||||
@docs[1].lines = [lines,lines,lines,lines]
|
||||
DocstoreClient.updateDoc @project_id, @docs[1]._id, @docs[1].lines, =>
|
||||
DocstoreClient.archiveAllDoc @project_id, (error, @res) =>
|
||||
|
|
|
@ -42,10 +42,15 @@ module.exports = DocstoreClient =
|
|||
}, callback
|
||||
|
||||
archiveAllDoc: (project_id, callback = (error, res, body) ->) ->
|
||||
request.get {
|
||||
url: "http://localhost:#{settings.internal.docstore.port}/project/#{project_id}/archive"
|
||||
request.post {
|
||||
url: "http://localhost:#{settings.internal.docstore.port}/project/#{project_id}/deactivate"
|
||||
}, callback
|
||||
|
||||
unArchiveAllDoc: (project_id, callback = (error, res, body) ->) ->
|
||||
request.post {
|
||||
url: "http://localhost:#{settings.internal.docstore.port}/project/#{project_id}/deactivate"
|
||||
}, callback
|
||||
|
||||
getS3Doc: (project_id, doc_id, callback = (error, res, body) ->) ->
|
||||
options = DocArchiveManager.buildS3Options(true, project_id+"/"+doc_id)
|
||||
request.get options, callback
|
||||
|
|
Loading…
Reference in a new issue