@onehat/data 1.19.37 → 1.19.39

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.37",
3
+ "version": "1.19.39",
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
+ loadOneAdditionalRecord = 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.');
@@ -395,7 +409,9 @@ class OneBuildRepository extends AjaxRepository {
395
409
  return null;
396
410
  }
397
411
 
398
- return this.createStandaloneEntity(root[0]);
412
+ const entity = this.createStandaloneEntity(root[0]);
413
+ entity.isRemotePhantom = false;
414
+ return entity;
399
415
  })
400
416
  .finally(() => {
401
417
  this.markLoading(false);