mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-20 02:03:48 +00:00
add un archive endpoint
This commit is contained in:
parent
cf07e2fec5
commit
599b9770f4
2 changed files with 10 additions and 1 deletions
|
@ -22,7 +22,8 @@ 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.get '/project/:project_id/archive', HttpController.archiveAllDocs
|
||||
app.post '/project/:project_id/archive', HttpController.archiveAllDocs
|
||||
app.post '/project/:project_id/unarchive', HttpController.unArchiveAllDocs
|
||||
|
||||
app.get '/status', (req, res)->
|
||||
res.send('docstore is alive')
|
||||
|
|
|
@ -86,3 +86,11 @@ module.exports = HttpController =
|
|||
DocArchive.archiveAllDocs project_id, (error) ->
|
||||
return next(error) if error?
|
||||
res.send 204
|
||||
|
||||
unArchiveAllDocs: (req, res, next = (error) ->) ->
|
||||
project_id = req.params.project_id
|
||||
logger.log project_id: project_id, "unarchiving all docs"
|
||||
DocArchive.unArchiveAllDocs project_id, (error) ->
|
||||
return next(error) if error?
|
||||
res.send 200
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue