Skip to content

Instantly share code, notes, and snippets.

@chanakaDe
Created July 25, 2016 15:10
Show Gist options
  • Save chanakaDe/c31a0c9f4a120924fce72f49c8a6e6ba to your computer and use it in GitHub Desktop.
Save chanakaDe/c31a0c9f4a120924fce72f49c8a6e6ba to your computer and use it in GitHub Desktop.
/**
* Created by chanaka on 8/13/15.
*/
module.factory('centerService', function ($http) {
var centerService = {
/**
* Fet all customers from the server.
* @returns {*}
*/
addCenter: function (data) {
return $http({
method: "POST",
data: data,
headers: headers,
url: host.center + '/save'
}).then(function (reponse) {
return reponse.data;
});
},
getAllCenterByBranchId: function (data) {
return $http({
method: "GET",
headers: headers,
url: host.center + '/getAllCentersByBranchId?branchId=' + data
}).then(function (response) {
return response.data;
});
},
getAllCenter: function (data) {
return $http({
method: "GET",
headers: headers,
url: host.center + '/getAll'
}).then(function (response) {
return response.data;
});
},
editCenter: function (data) {
return $http({
method: "POST",
data: data,
headers: headers,
url: host.center + '/update'
}).then(function (reponse) {
return reponse.data;
});
},
getcenterId: function (data) {
return $http({
method: "GET",
headers: headers,
url: host.center + '/getId?branchCode=' + data
}).then(function (response) {
return response.data;
});
}
};
return centerService;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment