diff --git a/client/js/homeController.js b/client/js/homeController.js index e87dc60..1adc008 100644 --- a/client/js/homeController.js +++ b/client/js/homeController.js @@ -317,7 +317,8 @@ saburiKonnect.controller('homeController', function($scope, $location, NewOrgani $scope.register = function() { - NewOrganisationFactory.addOrganisation($scope.organisation); + // console.log($scope.sponsor); + NewOrganisationFactory.addSponsor($scope.sponsor); }; }) @@ -328,13 +329,22 @@ saburiKonnect.controller('homeController', function($scope, $location, NewOrgani $http.post('/login', info).success(function(output){ // callback(output); if (!output.error) { - $location.path ("/kids") + if(output.status == false){ + $location.path ("/kids") + } + else{ + $location.path('/newkid') + } } }); }; - factory.addOrganisation = function(info,callback){ - $http.post('/add_organisation', info).success(function(output){ - callback(output); + factory.addSponsor = function(info,callback){ + // console.log(info); + $http.post('/add_sponsor', info).success(function(output){ + if(output.message == 'success'){ + $location.path('/static'); + } + }); }; return factory; diff --git a/client/partials/home.html b/client/partials/home.html index 49d6db6..2e45315 100644 --- a/client/partials/home.html +++ b/client/partials/home.html @@ -187,6 +187,7 @@