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')); ->requirements(array('backend', 'addressbookid'));
$this->create('contacts_address_book_delete', 'addressbook/{backend}/{addressbookid}/delete') $this->create('contacts_address_book_delete', 'addressbook/{backend}/{addressbookid}')
->post() ->delete()
->action( ->action(
function($params) { function($params) {
session_write_close(); session_write_close();
@ -76,8 +76,8 @@ $this->create('contacts_address_book_add_contact', 'addressbook/{backend}/{addre
) )
->requirements(array('backend', 'addressbookid')); ->requirements(array('backend', 'addressbookid'));
$this->create('contacts_address_book_delete_contact', 'addressbook/{backend}/{addressbookid}/contact/{contactid}/delete') $this->create('contacts_address_book_delete_contact', 'addressbook/{backend}/{addressbookid}/contact/{contactid}')
->post() ->delete()
->action( ->action(
function($params) { function($params) {
session_write_close(); session_write_close();

View File

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