[js] Using appropriate http method when calling a remote function to respect REST principles.
authorRabah Meradi <rabah.meradi@logilab.fr>
Tue, 23 Jun 2015 13:08:48 +0200
changeset 10456 e7ee508a8b2f
parent 10448 de5be53e2ea8
child 10457 1f5026e7d848
[js] Using appropriate http method when calling a remote function to respect REST principles. closes #5355952
web/data/cubicweb.ajax.js
web/data/cubicweb.edition.js
--- a/web/data/cubicweb.ajax.js	Fri May 15 23:05:54 2015 +0200
+++ b/web/data/cubicweb.ajax.js	Tue Jun 23 13:08:48 2015 +0200
@@ -500,7 +500,7 @@
 function unloadPageData() {
     // NOTE: do not make async calls on unload if you want to avoid
     //       strange bugs
-    loadRemote(AJAX_BASE_URL, ajaxFuncArgs('unload_page_data'), 'GET', true);
+    loadRemote(AJAX_BASE_URL, ajaxFuncArgs('unload_page_data'), 'POST', true);
 }
 
 function removeBookmark(beid) {
--- a/web/data/cubicweb.edition.js	Fri May 15 23:05:54 2015 +0200
+++ b/web/data/cubicweb.edition.js	Tue Jun 23 13:08:48 2015 +0200
@@ -171,7 +171,7 @@
     var entityForm = jQuery('#entityForm');
     var oid = optionNode.id.substring(2); // option id is prefixed by "id"
     loadRemote(AJAX_BASE_URL, ajaxFuncArgs('add_pending_inserts', null,
-                                           [oid.split(':')]), 'GET', true);
+                                           [oid.split(':')]), 'POST', true);
     var selectNode = optionNode.parentNode;
     // remove option node
     selectNode.removeChild(optionNode);