You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -4147,6 +4148,7 @@ function Resource(utils, options) {
4147
4148
* - `{string="id"}` - `idAttribute` - The attribute that specifies the primary key for this resource.
4148
4149
* - `{string=}` - `endpoint` - The attribute that specifies the primary key for this resource. Default is the value of `name`.
4149
4150
* - `{string=}` - `baseUrl` - The url relative to which all AJAX requests will be made.
4151
+
* - `{boolean=}` - `useClass` - Whether to use a wrapper class created from the ProperCase name of the resource. The wrapper will always be used for resources that have `methods` defined.
4150
4152
* - `{*=}` - `meta` - A property reserved for developer use. This will never be used by the API.
4151
4153
* - `{object=}` - `methods` - If provided, items of this resource will be wrapped in a constructor function that is
4152
4154
* empty save for the attributes in this option which will be mixed in to the constructor function prototype. Enabling
@@ -4172,6 +4174,7 @@ function defineResource(definition) {
4172
4174
varIA=this.errors.IA;
4173
4175
4174
4176
if(this.utils.isString(definition)){
4177
+
definition=definition.replace(/\s/gi,'');
4175
4178
definition={
4176
4179
name: definition
4177
4180
};
@@ -4210,10 +4213,11 @@ function defineResource(definition) {
Copy file name to clipboardExpand all lines: src/datastore/sync_methods/defineResource.js
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ function Resource(utils, options) {
50
50
* - `{string="id"}` - `idAttribute` - The attribute that specifies the primary key for this resource.
51
51
* - `{string=}` - `endpoint` - The attribute that specifies the primary key for this resource. Default is the value of `name`.
52
52
* - `{string=}` - `baseUrl` - The url relative to which all AJAX requests will be made.
53
+
* - `{boolean=}` - `useClass` - Whether to use a wrapper class created from the ProperCase name of the resource. The wrapper will always be used for resources that have `methods` defined.
53
54
* - `{*=}` - `meta` - A property reserved for developer use. This will never be used by the API.
54
55
* - `{object=}` - `methods` - If provided, items of this resource will be wrapped in a constructor function that is
55
56
* empty save for the attributes in this option which will be mixed in to the constructor function prototype. Enabling
@@ -75,6 +76,7 @@ function defineResource(definition) {
75
76
varIA=this.errors.IA;
76
77
77
78
if(this.utils.isString(definition)){
79
+
definition=definition.replace(/\s/gi,'');
78
80
definition={
79
81
name: definition
80
82
};
@@ -113,10 +115,11 @@ function defineResource(definition) {
0 commit comments