diff --git a/templates/js/controllers/tasksController.js b/templates/js/controllers/tasksController.js index c40af18..ab5e4be 100644 --- a/templates/js/controllers/tasksController.js +++ b/templates/js/controllers/tasksController.js @@ -6,24 +6,13 @@ angular.module('SeHub') $rootScope.seToken = $cookies['com.sehub.www']; var token = $rootScope.seToken; - $scope.createTaskClicked = function() { - $location.path("/tasks/new"); // Reference to 'newTask' page - } - - $scope.displayTasks = function() { - apiService.getAllFutureTasks(token).success(function(data) // Get all Tasks // TODO change to closest TASK - { - $scope.lecturerTasks = data; - console.log(data); - }).error(function(err) { - console.log(err.message); - }); - } - $scope.gotoTask = function(taskId) { - $location.path('/tasks/fill/' + taskId); - } - - $scope.displayTasks(); // Calling tasks with task id + $scope.user = $scope.$parent.user; + apiService.getAllUserTasks(token).success(function(data) { + $scope.tasks = data; + console.log(data); + }).error(function(err) { + console.log(err.message); + }); } diff --git a/templates/views/tasks.html b/templates/views/tasks.html index cac0a73..f162b9a 100644 --- a/templates/views/tasks.html +++ b/templates/views/tasks.html @@ -9,9 +9,9 @@