File tree Expand file tree Collapse file tree 5 files changed +25
-8
lines changed
Expand file tree Collapse file tree 5 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 1+ ### 1.1.2
2+ ** 2016-01-07**
3+
4+ * Fix bug with collection items request
5+ * Allow for both id as stand alone param, and id as part of options object
6+
17### 1.1.1
28** 2015-12-22**
39
Original file line number Diff line number Diff line change 1- Copyright (C) 2015 VHX, Inc. (https://vhx.com)
1+ Copyright (C) 2016 VHX, Inc. (https://vhx.com)
22
33Permission is hereby granted, free of charge, to any person obtaining a copy
44of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change 1- 1.1.1
1+ 1.1.2
Original file line number Diff line number Diff line change @@ -20,11 +20,23 @@ Resource.prototype = {
2020 client_method : method
2121 } ;
2222
23- if ( method . match ( / r e t r i e v e | u p d a t e | f i l e s / ) ) {
23+ if ( method . match ( / r e t r i e v e | u p d a t e | i t e m s | f i l e s / ) ) {
2424 _this [ method ] = function ( id , options , callback ) {
25- params . id = id ;
26- params . options = options ;
27- params . callback = callback ;
25+ if ( id . id && _this . isCallbackFunction ( options ) ) {
26+ params . callback = options ;
27+ params . id = id . id ;
28+ delete options . id ;
29+ params . options = id ;
30+ }
31+ else {
32+ params . id = id ;
33+ if ( _this . _this . isCallbackFunction ( options ) ) {
34+ params . callback = options ;
35+ } else {
36+ params . options = options ;
37+ params . callback = callback ;
38+ }
39+ }
2840
2941 _this . makeRequest ( params ) ;
3042 } ;
@@ -133,7 +145,6 @@ Resource.prototype = {
133145
134146 isCallbackFunction : function ( obj ) {
135147 return ! ! ( obj && obj . constructor && obj . call && obj . apply ) ;
136-
137148 }
138149} ;
139150
Original file line number Diff line number Diff line change 11{
22 "name" : " vhx" ,
3- "version" : " 1.1.1 " ,
3+ "version" : " 1.1.2 " ,
44 "description" : " VHX Node.js API Client" ,
55 "keywords" : [
66 " vhx" ,
You can’t perform that action at this time.
0 commit comments