Просмотр исходного кода

Remove obsolete `segmentation` payload in editing-session request

Shane Kilkelly 8 лет назад
Родитель
Сommit
b3f47ea44a

+ 1 - 1
services/web/app/coffee/Features/Analytics/AnalyticsController.coffee

@@ -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

+ 1 - 4
services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee

@@ -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"

+ 2 - 3
services/web/test/unit/coffee/Analytics/AnalyticsControllerTests.coffee

@@ -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()