@@ -96,7 +96,7 @@ if (forcetk.Client === undefined) {
9696 forcetk . Client . prototype . refreshAccessToken = function ( callback , error ) {
9797 var that = this ;
9898 var url = this . loginUrl + '/services/oauth2/token' ;
99- $j . ajax ( {
99+ return $j . ajax ( {
100100 type : 'POST' ,
101101 url : ( this . proxyUrl !== null ) ? this . proxyUrl : url ,
102102 cache : false ,
@@ -158,7 +158,7 @@ if (forcetk.Client === undefined) {
158158 var that = this ;
159159 var url = this . instanceUrl + '/services/data' + path ;
160160
161- $j . ajax ( {
161+ return $j . ajax ( {
162162 type : method || "GET" ,
163163 async : this . asyncAjax ,
164164 url : ( this . proxyUrl !== null ) ? this . proxyUrl : url ,
@@ -265,7 +265,7 @@ if (forcetk.Client === undefined) {
265265 var that = this ;
266266 var url = this . instanceUrl + '/services/apexrest' + path ;
267267
268- $j . ajax ( {
268+ return $j . ajax ( {
269269 type : method || "GET" ,
270270 async : this . asyncAjax ,
271271 url : ( this . proxyUrl !== null ) ? this . proxyUrl : url ,
@@ -312,7 +312,7 @@ if (forcetk.Client === undefined) {
312312 * @param [error=null] function to which jqXHR will be passed in case of error
313313 */
314314 forcetk . Client . prototype . versions = function ( callback , error ) {
315- this . ajax ( '/' , callback , error ) ;
315+ return this . ajax ( '/' , callback , error ) ;
316316 }
317317
318318 /*
@@ -322,7 +322,7 @@ if (forcetk.Client === undefined) {
322322 * @param [error=null] function to which jqXHR will be passed in case of error
323323 */
324324 forcetk . Client . prototype . resources = function ( callback , error ) {
325- this . ajax ( '/' + this . apiVersion + '/' , callback , error ) ;
325+ return this . ajax ( '/' + this . apiVersion + '/' , callback , error ) ;
326326 }
327327
328328 /*
@@ -332,7 +332,7 @@ if (forcetk.Client === undefined) {
332332 * @param [error=null] function to which jqXHR will be passed in case of error
333333 */
334334 forcetk . Client . prototype . describeGlobal = function ( callback , error ) {
335- this . ajax ( '/' + this . apiVersion + '/sobjects/' , callback , error ) ;
335+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' , callback , error ) ;
336336 }
337337
338338 /*
@@ -342,7 +342,7 @@ if (forcetk.Client === undefined) {
342342 * @param [error=null] function to which jqXHR will be passed in case of error
343343 */
344344 forcetk . Client . prototype . metadata = function ( objtype , callback , error ) {
345- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/'
345+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/'
346346 , callback , error ) ;
347347 }
348348
@@ -354,7 +354,7 @@ if (forcetk.Client === undefined) {
354354 * @param [error=null] function to which jqXHR will be passed in case of error
355355 */
356356 forcetk . Client . prototype . describe = function ( objtype , callback , error ) {
357- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype
357+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype
358358 + '/describe/' , callback , error ) ;
359359 }
360360
@@ -368,7 +368,7 @@ if (forcetk.Client === undefined) {
368368 * @param [error=null] function to which jqXHR will be passed in case of error
369369 */
370370 forcetk . Client . prototype . create = function ( objtype , fields , callback , error ) {
371- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/'
371+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/'
372372 , callback , error , "POST" , JSON . stringify ( fields ) ) ;
373373 }
374374
@@ -405,7 +405,7 @@ if (forcetk.Client === undefined) {
405405 * @param [error=null] function to which jqXHR will be passed in case of error
406406 */
407407 forcetk . Client . prototype . upsert = function ( objtype , externalIdField , externalId , fields , callback , error ) {
408- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + externalIdField + '/' + externalId
408+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + externalIdField + '/' + externalId
409409 + '?_HttpMethod=PATCH' , callback , error , "POST" , JSON . stringify ( fields ) ) ;
410410 }
411411
@@ -420,7 +420,7 @@ if (forcetk.Client === undefined) {
420420 * @param [error=null] function to which jqXHR will be passed in case of error
421421 */
422422 forcetk . Client . prototype . update = function ( objtype , id , fields , callback , error ) {
423- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + id
423+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + id
424424 + '?_HttpMethod=PATCH' , callback , error , "POST" , JSON . stringify ( fields ) ) ;
425425 }
426426
@@ -433,7 +433,7 @@ if (forcetk.Client === undefined) {
433433 * @param [error=null] function to which jqXHR will be passed in case of error
434434 */
435435 forcetk . Client . prototype . del = function ( objtype , id , callback , error ) {
436- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + id
436+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + id
437437 , callback , error , "DELETE" ) ;
438438 }
439439
@@ -445,7 +445,7 @@ if (forcetk.Client === undefined) {
445445 * @param [error=null] function to which jqXHR will be passed in case of error
446446 */
447447 forcetk . Client . prototype . query = function ( soql , callback , error ) {
448- this . ajax ( '/' + this . apiVersion + '/query?q=' + escape ( soql )
448+ return this . ajax ( '/' + this . apiVersion + '/query?q=' + escape ( soql )
449449 , callback , error ) ;
450450 }
451451
@@ -470,7 +470,7 @@ if (forcetk.Client === undefined) {
470470 //-- leave alone
471471 }
472472
473- this . ajax ( url , callback , error ) ;
473+ return this . ajax ( url , callback , error ) ;
474474 }
475475
476476 /*
@@ -481,7 +481,7 @@ if (forcetk.Client === undefined) {
481481 * @param [error=null] function to which jqXHR will be passed in case of error
482482 */
483483 forcetk . Client . prototype . search = function ( sosl , callback , error ) {
484- this . ajax ( '/' + this . apiVersion + '/search?q=' + escape ( sosl )
484+ return this . ajax ( '/' + this . apiVersion + '/search?q=' + escape ( sosl )
485485 , callback , error ) ;
486486 }
487487}
0 commit comments