mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
31 lines
1,004 B
CoffeeScript
31 lines
1,004 B
CoffeeScript
versioningApiHandler = require './VersioningApiHandler'
|
|
metrics = require('../../infrastructure/Metrics')
|
|
|
|
module.exports =
|
|
enableVersioning: (project_id, callback)->
|
|
metrics.inc "versioning.enableVersioning"
|
|
versioningApiHandler.enableVersioning project_id, callback
|
|
|
|
listVersions : (req, res) ->
|
|
metrics.inc "versioning.listVersions"
|
|
versioningApiHandler.proxyToVersioningApi(req, res)
|
|
|
|
getVersion : (req, res) ->
|
|
metrics.inc "versioning.getVersion"
|
|
versioningApiHandler.proxyToVersioningApi(req, res)
|
|
|
|
getVersionFile : (req, res) ->
|
|
metrics.inc "versioning.getVersionFile"
|
|
versioningApiHandler.proxyToVersioningApi(req, res)
|
|
|
|
takeSnapshot: (req, res, next) ->
|
|
metrics.inc "versioning.takeSnapshot"
|
|
if req.body? and req.body.message? and req.body.message.length > 0
|
|
message = req.body.message
|
|
else
|
|
message = "Manual snapshot"
|
|
versioningApiHandler.takeSnapshot req.params.Project_id, message, (error) ->
|
|
if error?
|
|
next(error)
|
|
else
|
|
res.send(200, "{}")
|