mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 07:39:02 +02:00
Remove obsolete segmentation payload in editing-session request
This commit is contained in:
@@ -11,7 +11,7 @@ module.exports = AnalyticsController =
|
||||
if userId?
|
||||
GeoIpLookup.getDetails req.ip, (err, geoDetails) ->
|
||||
countryCode = geoDetails?.country_code || null
|
||||
AnalyticsManager.updateEditingSession userId, projectId, countryCode, {}, (error) ->
|
||||
AnalyticsManager.updateEditingSession userId, projectId, countryCode, (error) ->
|
||||
respondWith(error, res, next)
|
||||
else
|
||||
res.send 204
|
||||
|
||||
@@ -43,7 +43,7 @@ module.exports =
|
||||
opts.qs = {fromV2: 1}
|
||||
makeRequest opts, callback
|
||||
|
||||
updateEditingSession: (userId, projectId, countryCode, segmentation = {}, callback = (error) ->) ->
|
||||
updateEditingSession: (userId, projectId, countryCode, callback = (error) ->) ->
|
||||
if userId+"" == settings.smokeTest?.userId+""
|
||||
return callback()
|
||||
query =
|
||||
@@ -52,9 +52,6 @@ module.exports =
|
||||
if countryCode
|
||||
query.countryCode = countryCode
|
||||
opts =
|
||||
body:
|
||||
segmentation: segmentation
|
||||
json: true
|
||||
method: "PUT"
|
||||
timeout: 1000
|
||||
url: "/editingSession"
|
||||
|
||||
@@ -14,7 +14,7 @@ describe 'AnalyticsController', ->
|
||||
getLoggedInUserId: sinon.stub()
|
||||
|
||||
@AnalyticsManager =
|
||||
updateEditingSession: sinon.stub().callsArgWith(4)
|
||||
updateEditingSession: sinon.stub().callsArgWith(3)
|
||||
recordEvent: sinon.stub().callsArgWith(3)
|
||||
|
||||
@controller = SandboxedModule.require modulePath, requires:
|
||||
@@ -43,8 +43,7 @@ describe 'AnalyticsController', ->
|
||||
@AnalyticsManager.updateEditingSession.calledWith(
|
||||
"1234",
|
||||
"a project id",
|
||||
'XY',
|
||||
{}
|
||||
'XY'
|
||||
).should.equal true
|
||||
done()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user