@communecter/cocolight-api-client 1.0.74 → 1.0.75

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": "@communecter/cocolight-api-client",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
@@ -548,12 +548,16 @@ export class BaseEntity<TServerData = any> {
548
548
  const transformed = this._transformServerData(newData);
549
549
  const incoming = (transformed ?? {});
550
550
  if (this._serverData && isReactive(this._serverData)) {
551
- // Delete all existing properties to ensure fields removed on the server are also removed locally
551
+ // Delete only properties that no longer exist in the incoming data to ensure fields removed on the server are also removed locally
552
552
  for (const key of Object.keys(this._serverData)) {
553
- delete this._serverData[key];
553
+ if (!(key in incoming)) {
554
+ delete (this._serverData as any)[key];
555
+ }
556
+ }
557
+ // Update or add properties from the incoming data (preserves reactive signals)
558
+ for (const key of Object.keys(incoming)) {
559
+ (this._serverData as any)[key] = (incoming as any)[key];
554
560
  }
555
- // Assign new properties
556
- Object.assign(this._serverData, incoming);
557
561
  } else {
558
562
  this._serverData = reactive({ ...incoming }) as TServerData & ReactiveData;
559
563
  }