summaryrefslogtreecommitdiffstats
path: root/js/services/contact_service.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/services/contact_service.js')
-rw-r--r--js/services/contact_service.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/services/contact_service.js b/js/services/contact_service.js
new file mode 100644
index 00000000..bbdc0df9
--- /dev/null
+++ b/js/services/contact_service.js
@@ -0,0 +1,21 @@
+app.service('ContactService', [ 'DavClient', function(DavClient) {
+
+ this.create = function(addressBook) {
+ // push contact to server
+ return DavClient.createCard(addressBook);
+ };
+
+ this.update = function(contact) {
+ // update contact on server
+ return DavClient.updateCard(contact, {json: true});
+ };
+
+ this.remove = function(contact) {
+ // delete contact from server
+ return DavClient.deleteCard(contact);
+ };
+
+ this.fromArray = function(array) {
+ // from array to contact
+ };
+}]); \ No newline at end of file