Commit 52f1874fe6fd24735b47d88d4e599b38fb861c65

Authored by Jaideep Singh
1 parent ccab6d2eb2
Exists in master

dashboard price manager update and primary contact bug fix

app/partials/dashboard/dashboard.service.js
... ... @@ -38,13 +38,13 @@
38 38 return deferred.promise;
39 39 }
40 40  
41   - this.getFuelPricingNew = function() {
42   -
  41 + this.updateFuelPricing = function(data){
43 42 var deferred = $q.defer();
44 43 $http({
45   - method : 'GET',
46   - url : BASE_URL.url +'/user/products',
  44 + method : 'POST',
  45 + url : BASE_URL.url +'/fuelPricing',
47 46 headers : {'Content-Type': 'application/json'},
  47 + data: data
48 48 })
49 49 .then(function (result){
50 50 deferred.resolve(result.data);
... ...
app/partials/viewVendorContact/viewVendorContact.Controller.js
... ... @@ -171,10 +171,16 @@
171 171 if($scope.contactDetail.primaryContact == true){
172 172 ViewFuelVendorService.checkPrimaryContact(companyId).then(function(result) {
173 173 console.log(result)
174   - if(result.status == 422){
  174 + if(result.status == 422 || result.status == 200){
175 175 $('#primaryContact').css('display', 'block');
176 176 }
177 177 })
  178 + }else{
  179 + var primaryContactData = "companyContactId=" + $scope.contactDetail.id + "&primary=false";
  180 +
  181 + ViewCompanyService.addPrimaryContact(primaryContactData).then(function(result) {
  182 + console.log(result)
  183 + })
178 184 }
179 185 }
180 186  
... ...
app/partials/viewcontact/viewcontact.controller.js
... ... @@ -176,10 +176,16 @@
176 176 if($scope.contactDetail.primaryContact == true){
177 177 ViewCompanyService.checkPrimaryContact(companyId).then(function(result) {
178 178 console.log(result)
179   - if(result.status == 422){
  179 + if(result.status == 422 || result.status == 200){
180 180 $('#primaryContact').css('display', 'block');
181 181 }
182 182 })
  183 + }else{
  184 + var primaryContactData = "companyContactId=" + $scope.contactDetail.id + "&primary=false";
  185 +
  186 + ViewCompanyService.addPrimaryContact(primaryContactData).then(function(result) {
  187 + console.log(result)
  188 + })
183 189 }
184 190 }
185 191  
... ... @@ -191,9 +197,9 @@
191 197  
192 198 $scope.sendPrimaryContact = function(id){
193 199 $('#primaryContact').css('display', 'none');
194   - var priamryContactData = "companyContactId=" + id + "&primary=" + $scope.contactDetail.primaryContact;
  200 + var primaryContactData = "companyContactId=" + id + "&primary=" + $scope.contactDetail.primaryContact;
195 201  
196   - ViewCompanyService.addPrimaryContact(priamryContactData).then(function(result) {
  202 + ViewCompanyService.addPrimaryContact(primaryContactData).then(function(result) {
197 203 console.log(result)
198 204 })
199 205  
... ...