Blame view

app/partials/viewCompany/viewCompany.service.js 1.66 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
29
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
55
        	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',
                url : BASE_URL.url +'/company/contact/'+id,
                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;
          }
4bb02bb84   Rishav   new integration w...
56
57
58
59
          
        }
        
  })();