mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
11 lines
412 B
CoffeeScript
11 lines
412 B
CoffeeScript
RangesManager = require "./RangesManager"
|
|
logger = require "logger-sharelatex"
|
|
|
|
module.exports = RangesController =
|
|
getAllRanges: (req, res, next) ->
|
|
project_id = req.params.project_id
|
|
logger.log {project_id}, "request for project ranges"
|
|
RangesManager.getAllRanges project_id, (error, docs = []) ->
|
|
return next(error) if error?
|
|
docs = ({id: d._id, ranges: d.ranges} for d in docs)
|
|
res.json docs
|