@onehat/data 1.19.38 → 1.19.40

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.19.38",
3
+ "version": "1.19.40",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -346,6 +346,20 @@ class OneBuildRepository extends AjaxRepository {
346
346
  return duplicateEntity;
347
347
  }
348
348
 
349
+ loadOneAdditionalEntity = async (id) => {
350
+ const entity = await this.getSingleEntityFromServer(id);
351
+ if (!entity) {
352
+ this.throwError('entity not found');
353
+ return;
354
+ }
355
+
356
+ this._relayEntityEvents(entity);
357
+ this.entities.push(entity);
358
+ this.total++;
359
+ this._setPaginationVars();
360
+ this.emit('changeData', this.entities);
361
+ }
362
+
349
363
  getSingleEntityFromServer = async (id) => {
350
364
  if (this.isDestroyed) {
351
365
  this.throwError('this.getSingleEntityFromServer is no longer valid. Repository has been destroyed.');