@onehat/data 1.8.3 → 1.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.8.3",
3
+ "version": "1.8.6",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/Entity.js CHANGED
@@ -152,9 +152,11 @@ class Entity extends EventEmitter {
152
152
  },
153
153
  set (target, name, value, receiver) {
154
154
  if (!Reflect.has(target, name)) {
155
- return target.setValue(name, value);
155
+ target.setValue(name, value);
156
+ } else {
157
+ Reflect.set(target, name, value, receiver);
156
158
  }
157
- return Reflect.set(target, name, value, receiver);
159
+ return true; // Return true, or else we sometimes get a proxy trap type error. https://developer.mozilla.org/en-US/docs/web/javascript/reference/global_objects/proxy/proxy/set
158
160
  },
159
161
  });
160
162
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  import FloatProperty from './Float';
4
4
  import Formatters from '../Util/Formatters';
5
+ import _ from 'lodash';
5
6
 
6
7
  /**
7
8
  * Class represents a Property that stores a percentage value.
@@ -291,6 +291,36 @@ class OneBuildRepository extends AjaxRepository {
291
291
  });
292
292
  }
293
293
 
294
+ forgotPassword = (email = null, username = null) => {
295
+ const data = {
296
+ url: 'forgotPassword',
297
+ data: qs.stringify({
298
+ email,
299
+ username,
300
+ }),
301
+ method: 'POST',
302
+ baseURL: this.api.baseURL,
303
+ };
304
+
305
+ if (this.debugMode) {
306
+ console.log('forgotPassword', data);
307
+ }
308
+
309
+ return this.axios(data)
310
+ .then((result) => {
311
+ if (this.debugMode) {
312
+ console.log('forgotPassword result', result);
313
+ }
314
+
315
+ const response = result.data;
316
+ if (!response.success) {
317
+ throw new Error(response.data);
318
+ }
319
+
320
+ return response;
321
+ });
322
+ }
323
+
294
324
  }
295
325
 
296
326