1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Contacts: Small steps towards RESTfulness

This commit is contained in:
Thomas Tanghus 2013-04-25 04:50:45 +02:00
parent 5ccd3a04bb
commit ec86678dec
2 changed files with 9 additions and 9 deletions

View File

@ -56,8 +56,8 @@ $this->create('contacts_address_book_add', 'addressbook/{backend}/add')
)
->requirements(array('backend', 'addressbookid'));
$this->create('contacts_address_book_delete', 'addressbook/{backend}/{addressbookid}/delete')
->post()
$this->create('contacts_address_book_delete', 'addressbook/{backend}/{addressbookid}')
->delete()
->action(
function($params) {
session_write_close();
@ -76,8 +76,8 @@ $this->create('contacts_address_book_add_contact', 'addressbook/{backend}/{addre
)
->requirements(array('backend', 'addressbookid'));
$this->create('contacts_address_book_delete_contact', 'addressbook/{backend}/{addressbookid}/contact/{contactid}/delete')
->post()
$this->create('contacts_address_book_delete_contact', 'addressbook/{backend}/{addressbookid}/contact/{contactid}')
->delete()
->action(
function($params) {
session_write_close();

View File

@ -92,7 +92,7 @@ OC.Contacts = OC.Contacts || {};
console.log('Storage.deleteAddressBook', backend, addressbookid);
return this.requestRoute(
'contacts_address_book_delete',
'POST',
'DELETE',
{backend: 'local', addressbookid: addressbookid}
);
}
@ -146,7 +146,7 @@ OC.Contacts = OC.Contacts || {};
return this.requestRoute(
'contacts_address_book_add_contact',
'POST',
{user: this.user, backend: backend, addressbookid: addressbookid}
{backend: backend, addressbookid: addressbookid}
);
}
@ -161,8 +161,8 @@ OC.Contacts = OC.Contacts || {};
console.log('Storage.deleteContact', backend, addressbookid, contactid);
return this.requestRoute(
'contacts_address_book_delete_contact',
'POST',
{user: this.user, backend: backend, addressbookid: addressbookid, contactid: contactid}
'DELETE',
{backend: backend, addressbookid: addressbookid, contactid: contactid}
);
}
@ -178,7 +178,7 @@ OC.Contacts = OC.Contacts || {};
var photo = new Image();
var url = OC.Router.generate(
'contacts_contact_photo',
{user: this.user, backend: backend, addressbookid: addressbookid, contactid: contactid}
{backend: backend, addressbookid: addressbookid, contactid: contactid}
);
var defer = $.Deferred();
$.when(