mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix up makeRequest, so it copes with analytics.url
being un-configured.
This commit is contained in:
parent
5b3cd7ed2b
commit
f9774141b1
1 changed files with 6 additions and 4 deletions
|
@ -4,8 +4,10 @@ _ = require "underscore"
|
||||||
request = require "request"
|
request = require "request"
|
||||||
|
|
||||||
|
|
||||||
makeRequest: (opts, callback)->
|
makeRequest = (opts, callback)->
|
||||||
if settings.apis?.analytics?.url?
|
if settings.apis?.analytics?.url?
|
||||||
|
urlPath = opts.url
|
||||||
|
opts.url = "#{settings.apis.analytics.url}#{urlPath}"
|
||||||
request opts, callback
|
request opts, callback
|
||||||
else
|
else
|
||||||
callback()
|
callback()
|
||||||
|
@ -25,7 +27,7 @@ module.exports =
|
||||||
json:true
|
json:true
|
||||||
method:"POST"
|
method:"POST"
|
||||||
timeout:1000
|
timeout:1000
|
||||||
url: "#{settings.apis.analytics.url}/user/#{user_id}/event"
|
url: "/user/#{user_id}/event"
|
||||||
makeRequest opts, callback
|
makeRequest opts, callback
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +38,7 @@ module.exports =
|
||||||
json:true
|
json:true
|
||||||
method:"POST"
|
method:"POST"
|
||||||
timeout:1000
|
timeout:1000
|
||||||
url: "#{settings.apis.analytics.url}/user/#{user_id}/event/last_occurnace"
|
url: "/user/#{user_id}/event/last_occurnace"
|
||||||
makeRequest opts, (err, response, body)->
|
makeRequest opts, (err, response, body)->
|
||||||
if err?
|
if err?
|
||||||
console.log response, opts
|
console.log response, opts
|
||||||
|
|
Loading…
Reference in a new issue