diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index 7b4ed92..b0d3d59 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -47,8 +47,6 @@ angular.module('SeHub') console.log($scope.courseObj); if($scope.msg.msgToAdd != null && $scope.courseObj.courseName) { - console.log("NOW"); - jsonNewMsg = { 'groupId': $scope.courseObj.id, // TODO Should be ===> $scope.courseObj.id 'message': $scope.msg.msgToAdd @@ -56,13 +54,11 @@ angular.module('SeHub') apiService.createMessage(token, jsonNewMsg).success(function(data) { + $scope.userMessages.push(data); }).error(function(err) { console.log(err.message); }); - - $scope.userMessages.push({"text": $scope.msg.msgToAdd}); - $location.path('/home/'); } else {