Преглед изворни кода

review fixes and moving licences endpoint to module

hugh-obrien пре 8 година
родитељ
комит
bd721d52f4

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

@@ -25,11 +25,10 @@ module.exports = AnalyticsController =
 			respondWith(error, res, next)
 
 	licences: (req, res, next) ->
-		AuthenticationController.getLoggedInUserId(req) or req.sessionID
 		{resource_id, start_date, end_date, lag} = req.query
 		InstitutionsAPI.getInstitutionLicences resource_id, start_date, end_date, lag, (error, licences) ->
 			if error?
-				res.send 503
+				next(error)
 			else
 				res.send licences
 

+ 0 - 2
services/web/app/coffee/Features/Analytics/AnalyticsRouter.coffee

@@ -9,8 +9,6 @@ module.exports =
 		webRouter.put  '/editingSession/:projectId',
 			AnalyticsController.updateEditingSession
 
-		webRouter.get '/graphs/licences', AnalyticsController.licences
-
 		publicApiRouter.use '/analytics/graphs',
 			AuthenticationController.httpAuth,
 			AnalyticsProxy.call('/graphs')

+ 1 - 1
services/web/app/coffee/Features/Institutions/InstitutionsAPI.coffee

@@ -16,7 +16,7 @@ module.exports = InstitutionsAPI =
 			method: 'GET'
 			path: "/api/v2/institutions/#{institutionId.toString()}/institution_licences"
 			body: {start_date: startDate, end_date: endDate, lag}
-			defaultErrorMessage: "Couldn't get institution affiliations"
+			defaultErrorMessage: "Couldn't get institution licences"
 		}, callback
 
 	getUserAffiliations: (userId, callback = (error, body) ->) ->