Fix to the GetCoursesByUserId in Profile

This commit is contained in:
Sagi Dayan 2015-06-29 14:25:20 +03:00
parent edac533f2b
commit f0031dca16
2 changed files with 22 additions and 18 deletions

View file

@ -18,6 +18,11 @@ angular.module('SeHub')
apiService.getCampusesByUserId(token, id).success(function(data) { apiService.getCampusesByUserId(token, id).success(function(data) {
$scope.campuses = data; $scope.campuses = data;
console.log(data); console.log(data);
apiService.getCoursesByUserID(token, id).success(function(data){
$scope.courses = data;
}).error(function(err){
console.error('In apiService.getCoursesByUserID', err);
})
$scope.loadingData = false; $scope.loadingData = false;
}).error(function(err) { }).error(function(err) {
@ -53,22 +58,22 @@ angular.module('SeHub')
/** /**
* DEBUG DATA * DEBUG DATA
*/ */
$scope.courses = [{ // $scope.courses = [{
"courseName": "Advance Math", // "courseName": "Advance Math",
"campusName": "JCE", // "campusName": "JCE",
"startDate": { // "startDate": {
"year": 2015, // "year": 2015,
"month": 4, // "month": 4,
"day": 3 // "day": 3
}, // },
"endDate": { // "endDate": {
"year": 2016, // "year": 2016,
"month": 5, // "month": 5,
"day": 14 // "day": 14
}, // },
"taskFlag": false, // "taskFlag": false,
"campus_avatar": "https://yt3.ggpht.com/--ZkWxybWGOM/AAAAAAAAAAI/AAAAAAAAAAA/_nAICC_kzzI/s88-c-k-no/photo.jpg" // "campus_avatar": "https://yt3.ggpht.com/--ZkWxybWGOM/AAAAAAAAAAI/AAAAAAAAAAA/_nAICC_kzzI/s88-c-k-no/photo.jpg"
}]; // }];
// $scope.campuses = [{ // $scope.campuses = [{
// 'title': 'JCE', // 'title': 'JCE',

View file

@ -173,8 +173,7 @@ service.factory('apiService', ['$http', function($http) {
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + userId; var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/courses/getCoursesByUser/" + token + "/" + userId;
req = { req = {
method : "GET", method : "GET",
url : url, url : url
data: payLoad
}; };
return $http(req); return $http(req);
} }