mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
13 lines
442 B
CoffeeScript
13 lines
442 B
CoffeeScript
|
HistoryManager = require "./HistoryManager"
|
||
|
logger = require "logger-sharelatex"
|
||
|
|
||
|
module.exports = HttpController =
|
||
|
appendUpdates: (req, res, next = (error) ->) ->
|
||
|
doc_id = req.params.doc_id
|
||
|
docOps = req.body.docOps
|
||
|
version = req.body.version
|
||
|
logger.log doc_id: doc_id, version: version, "compressing doc history"
|
||
|
HistoryManager.compressAndSaveRawUpdates doc_id, docOps, (error) ->
|
||
|
return next(error) if error?
|
||
|
res.send 204
|