Created
July 25, 2016 15:10
-
-
Save chanakaDe/c31a0c9f4a120924fce72f49c8a6e6ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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