mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
18 lines
No EOL
546 B
CoffeeScript
18 lines
No EOL
546 B
CoffeeScript
request = require 'request'
|
|
settings = require 'settings-sharelatex'
|
|
Errors = require '../Errors/Errors'
|
|
|
|
makeRequest = (opts, callback) ->
|
|
if settings.apis?.olProjects?.url?
|
|
urlPath = opts.url
|
|
opts.url = "#{settings.apis.olProjects.url}#{urlPath}"
|
|
request opts, callback
|
|
else
|
|
callback(new Errors.ServiceNotConfiguredError('OL Projects service not configured'))
|
|
|
|
module.exports = OlProjectGetter =
|
|
findAllUsersProjects: (userId, callback = (error, projects) ->) ->
|
|
opts =
|
|
method: 'GET'
|
|
url: '/api/v0/current_user'
|
|
json: true |