2016-02-29 00:49:18 -04:30
|
|
|
(function(){
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
angular
|
|
|
|
|
.module('app.professor')
|
|
|
|
|
.factory('professors', professors)
|
2016-06-07 22:46:09 -04:00
|
|
|
.factory('passwordReset', passwordReset)
|
2016-03-27 23:24:28 -04:30
|
|
|
.value('selectedCourse',{})
|
|
|
|
|
.value('selectedSection',{})
|
2016-04-11 00:05:59 -04:30
|
|
|
.value('selectedStudent',{})
|
2016-04-27 20:34:27 -04:30
|
|
|
.value('profesorSeleccionado',{})
|
|
|
|
|
.value('data',{});
|
2016-02-29 00:49:18 -04:30
|
|
|
|
2016-05-20 23:00:34 -04:00
|
|
|
professors.$inject = ['$resource','$rootScope','authentication'];
|
|
|
|
|
function professors($resource, $rootScope, authentication){
|
|
|
|
|
return $resource('http://'+$rootScope.domainUrl+'/professors/:id', {}, {
|
|
|
|
|
get: {
|
|
|
|
|
method: 'GET',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: 'Bearer '+ authentication.getToken()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
update: {
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: 'Bearer '+ authentication.getToken()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
delete: {
|
|
|
|
|
method: 'DELETE',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: 'Bearer '+ authentication.getToken()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
query: {
|
|
|
|
|
method: 'GET',
|
|
|
|
|
isArray:true,
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: 'Bearer '+ authentication.getToken()
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-02-29 00:49:18 -04:30
|
|
|
});
|
|
|
|
|
};
|
2016-06-07 22:46:09 -04:00
|
|
|
passwordReset.$inject = ['$resource','$rootScope','authentication'];
|
|
|
|
|
function passwordReset($resource, $rootScope, authentication){
|
|
|
|
|
return $resource('http://'+$rootScope.domainUrl+'/reset/:id', {}, {
|
|
|
|
|
update: {
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: 'Bearer '+ authentication.getToken()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
2016-02-29 00:49:18 -04:30
|
|
|
})();
|