Commit 4a6ed671 authored by EXT Hélène David's avatar EXT Hélène David
Browse files

get university id

parent 9673dd61
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* Controllers */ /* Controllers */
root.controller('UnivCompanyOffers' ,['$scope','$http','$stateParams','$projectFactory','$state','$companyFactory', function($scope,$http,$stateParams,$projectFactory,$state,$companyFactory) { root.controller('UnivCompanyOffers' ,['$scope','$http','$stateParams','$projectFactory','$state','$companyFactory','$universityFactory', function($scope,$http,$stateParams,$projectFactory,$state,$companyFactory,$universityFactory) {
$scope.offers = {elements:[]} $scope.offers = {elements:[]}
$scope.newOffer = {source:"waza"}; $scope.newOffer = {source:"waza"};
...@@ -68,8 +68,7 @@ root.controller('UnivCompanyOffers' ,['$scope','$http','$stateParams','$projectF ...@@ -68,8 +68,7 @@ root.controller('UnivCompanyOffers' ,['$scope','$http','$stateParams','$projectF
} }
$scope.init = function(){ $scope.init = function(){
$scope.newOffer = {source:"waza"}; $scope.newOffer = {source:"EDCampus"};
var session = $scope._getSession();
$companyFactory.getCompanyOffers($scope.entrepriseId,false,function(data) { $companyFactory.getCompanyOffers($scope.entrepriseId,false,function(data) {
if(data.status == "success"){ if(data.status == "success"){
$scope.offers.elements =data.details; $scope.offers.elements =data.details;
...@@ -84,7 +83,12 @@ root.controller('UnivCompanyOffers' ,['$scope','$http','$stateParams','$projectF ...@@ -84,7 +83,12 @@ root.controller('UnivCompanyOffers' ,['$scope','$http','$stateParams','$projectF
$companyFactory.addCompanyOffer($scope.entrepriseId,$scope.newOffer,function(data) { $companyFactory.addCompanyOffer($scope.entrepriseId,$scope.newOffer,function(data) {
if(data.status == "success"){ if(data.status == "success"){
var offerId = data.details; var offerId = data.details;
$companyFactory.addUniversityEntrepriseOffer($scope.campus.id,offerId,function(data) { var session = $scope._getSession();
$universityFactory.getMainUniversityByUser(session.user,function(univ){
$scope.univeristyId = univ;
})
$companyFactory.addUniversityEntrepriseOffer($scope.univeristyId,offerId,function(data) {
if(data.status == "success"){ if(data.status == "success"){
$scope.init(); $scope.init();
$scope.currentSection='listOffers'; $scope.currentSection='listOffers';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment