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

changed :project_id to :Project_id

Henry Oswald 12 лет назад
Родитель
Сommit
9f82e63a8f

+ 2 - 2
services/web/app/coffee/Features/Chat/ChatController.coffee

@@ -6,7 +6,7 @@ module.exports =
 
 
 	sendMessage: (req, res)->
-		{project_id} = req.params
+		project_id = req.params.Project_id
 		user_id = req.session.user._id
 		messageContent = req.body.content
 		ChatHandler.sendMessage project_id, user_id, messageContent, (err, builtMessge)->
@@ -17,7 +17,7 @@ module.exports =
 			res.send()
 
 	getMessages: (req, res)->
-		{project_id} = req.params
+		project_id = req.params.Project_id
 		query = req.body
 		logger.log project_id:project_id, query:query, "getting messages"
 		ChatHandler.getMessages project_id, query, (err, messages)->

+ 2 - 2
services/web/app/coffee/router.coffee

@@ -160,8 +160,8 @@ module.exports = class Router
 		app.post "/spelling/check", AuthenticationController.requireLogin(), SpellingController.proxyRequestToSpellingApi
 		app.post "/spelling/learn", AuthenticationController.requireLogin(), SpellingController.proxyRequestToSpellingApi
 
-		app.get  "/project/:project_id/messages", SecurityManager.requestCanAccessProject, ChatController.getMessages
-		app.post "/project/:project_id/messages", SecurityManager.requestCanAccessProject, ChatController.sendMessage
+		app.get  "/project/:Project_id/messages", SecurityManager.requestCanAccessProject, ChatController.getMessages
+		app.post "/project/:Project_id/messages", SecurityManager.requestCanAccessProject, ChatController.sendMessage
 
 		#Admin Stuff
 		app.get  '/admin', SecurityManager.requestIsAdmin, AdminController.index

+ 1 - 1
services/web/test/UnitTests/coffee/Chat/ChatControllerTests.coffee

@@ -27,7 +27,7 @@ describe "ChatController", ->
 
 		@req =
 			params:
-				project_id:@project_id
+				Project_id:@project_id
 			session:
 				user:
 					_id:@user_id