@statezero/core 0.1.69 → 0.1.70

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.
@@ -128,8 +128,15 @@ export class ModelStore {
128
128
  return;
129
129
  }
130
130
  }
131
- item[pkField] = pk;
132
- nonTempPkItems.push(item);
131
+ if (item && typeof item.serialize === "function") {
132
+ const serializedItem = item.serialize();
133
+ serializedItem[pkField] = pk;
134
+ nonTempPkItems.push(serializedItem);
135
+ }
136
+ else {
137
+ item[pkField] = pk;
138
+ nonTempPkItems.push(item);
139
+ }
133
140
  });
134
141
  this.modelCache.set(this.cacheKey, nonTempPkItems);
135
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statezero/core",
3
- "version": "0.1.69",
3
+ "version": "0.1.70",
4
4
  "type": "module",
5
5
  "module": "ESNext",
6
6
  "description": "The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate",