Blame view

app/partials/viewCompany/viewCompany.service.js 3.08 KB
4bb02bb84   Rishav   new integration w...
1
2
3
  (function(){
   'use strict';    
      angular.module('acufuel')
55e075d7e   Rishav   add contact, add ...
4
        .service('ViewCompanyService', ['$q', '$http', 'BASE_URL', ViewCompanyService]);
4bb02bb84   Rishav   new integration w...
5

55e075d7e   Rishav   add contact, add ...
6
        function ViewCompanyService($q, $http, BASE_URL) {        
4bb02bb84   Rishav   new integration w...
7
          
55e075d7e   Rishav   add contact, add ...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
        	this.getCompany = function(id) {
  
            var deferred = $q.defer();
            $http({
                method : 'GET',
                url : BASE_URL.url +'/company/'+id,
                headers : {'Content-Type': 'application/json'},
            })
            .then(function (result){
                deferred.resolve(result.data);
            },function (result){
                deferred.resolve(result.data);
            })
            return deferred.promise;
          }
  
          this.getContact = function(id) {
  
            var deferred = $q.defer();
            $http({
                method : 'GET',
3cab9e8a3   Rishav   implement view co...
29
                url : BASE_URL.url +'/company/contacts/'+id,
55e075d7e   Rishav   add contact, add ...
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
                headers : {'Content-Type': 'application/json'},
            })
            .then(function (result){
                deferred.resolve(result.data);
            },function (result){
                deferred.resolve(result.data);
            })
            return deferred.promise;
          }
  
          this.addContact = function(data) {
  
            var deferred = $q.defer();
            $http({
                method : 'POST',
                url : BASE_URL.url +'/company/add/contact',
                data : data,
                headers : {'Content-Type': 'application/json'},
            })
            .then(function (result){
                deferred.resolve(result.data);
            },function (result){
                deferred.resolve(result.data);
            })
            return deferred.promise;
fd20aa6ce   Rishav   send confirmation...
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
          }
  
          this.sendMail = function(id) {
  
            var deferred = $q.defer();
            $http({
                method : 'POST',
                url : BASE_URL.url +'/mailPriceToContacts/'+id,
                headers : {'Content-Type': 'application/json'},
            })
            .then(function (result){
                deferred.resolve(result.data);
            },function (result){
                deferred.resolve(result.data);
            })
            return deferred.promise;
55e075d7e   Rishav   add contact, add ...
71
          }
b1f6160d4   Rishav   add contact and a...
72

48ed0c7bb   Rishav   update company co...
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
          this.updateContact = function(data) {
  
            var deferred = $q.defer();
            $http({
                method : 'PUT',
                url : BASE_URL.url +'/company',
                data : data,
                headers : {'Content-Type': 'application/json'},
            })
            .then(function (result){
                deferred.resolve(result.data);
            },function (result){
                deferred.resolve(result.data);
            })
            return deferred.promise;
          }
b1f6160d4   Rishav   add contact and a...
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
          this.getAircraft = function(id) {
  
            var deferred = $q.defer();
            $http({
                method : 'GET',
                url : BASE_URL.url +'/company/aircrafts/'+id,
                headers : {'Content-Type': 'application/json'},
            })
            .then(function (result){
                deferred.resolve(result.data);
            },function (result){
                deferred.resolve(result.data);
            })
            return deferred.promise;
          }
4bb02bb84   Rishav   new integration w...
104
105
106
107
          
        }
        
  })();