From e6692828de1f9f6c093260d0cfc8cde8395923d7 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 6 Mar 2008 19:32:07 +0000 Subject: [PATCH] added support for ses.request(method, param1, param2, ...) style requests git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1259 9efc2488-bf62-4759-914b-345cdb29e865 --- src/javascript/opensrf.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/javascript/opensrf.js b/src/javascript/opensrf.js index 6f93379..e52c145 100644 --- a/src/javascript/opensrf.js +++ b/src/javascript/opensrf.js @@ -108,9 +108,21 @@ OpenSRF.set_subclass('OpenSRF.ClientSession', 'OpenSRF.Session'); OpenSRF.ClientSession.prototype.request = function(args) { + + if(typeof args == 'string') { + params = []; + for(var i = 1; i < arguments.length; i++) + params.push(arguments[i]); + + args = { + method : args, + params : params + }; + } + var req = new OpenSRF.Request(this, this.last_id++, args); this.requests.push(req); - req.send(); + return req; } OpenSRF.ClientSession.prototype.find_request = function(reqid) { -- 2.11.0