@onehat/data 1.8.4 → 1.8.5

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.4",
3
+ "version": "1.8.5",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -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