Blame view

app/partials/dashboard/dashboard.service.js 1.65 KB
4bb02bb84   Rishav   new integration w...
1
2
3
  (function(){
   'use strict';    
      angular.module('acufuel')
9732e9b36   Swarn Singh   updates in fuel m...
4
        .service('dashboardService', ['$q', '$http', 'BASE_URL', dashboardService]);
4bb02bb84   Rishav   new integration w...
5

9732e9b36   Swarn Singh   updates in fuel m...
6
        function dashboardService($q, $http, BASE_URL) {
4bb02bb84   Rishav   new integration w...
7
          var temp = {};
9732e9b36   Swarn Singh   updates in fuel m...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
          this.getFuelPricingNew = function() {
  
            var deferred = $q.defer();
            $http({
                method : 'GET',
                url : BASE_URL.url +'/user/products',
                headers : {'Content-Type': 'application/json'},
            })
            .then(function (result){
                deferred.resolve(result.data);
            },function (result){
                deferred.resolve(result.data);
            })
            return deferred.promise;
          }
6275a96f0   Jaideep Singh   s
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
           this.getMargin = function() {
  
            var deferred = $q.defer();
            $http({
                method : 'GET',
                url : BASE_URL.url +'/user/margins',
                headers : {'Content-Type': 'application/json'},
            })
            .then(function (result){
                deferred.resolve(result.data);
            },function (result){
                deferred.resolve(result.data);
            })
            return deferred.promise;
          }
52f1874fe   Jaideep Singh   dashboard price m...
38
         this.updateFuelPricing = function(data){
9732e9b36   Swarn Singh   updates in fuel m...
39
40
            var deferred = $q.defer();
            $http({
52f1874fe   Jaideep Singh   dashboard price m...
41
42
                method : 'POST',
                url : BASE_URL.url +'/fuelPricing',
9732e9b36   Swarn Singh   updates in fuel m...
43
                headers : {'Content-Type': 'application/json'},
52f1874fe   Jaideep Singh   dashboard price m...
44
                data: data
9732e9b36   Swarn Singh   updates in fuel m...
45
46
47
48
49
50
51
52
            })
            .then(function (result){
                deferred.resolve(result.data);
            },function (result){
                deferred.resolve(result.data);
            })
            return deferred.promise;
          }
4bb02bb84   Rishav   new integration w...
53
54
55
56
          
        }
        
  })();