@communecter/cocolight-api-client 1.0.70 → 1.0.72
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/dist/cocolight-api-client.browser.js +1 -1
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
- package/package.json +1 -1
- package/src/api/BaseEntity.ts +13 -0
- package/src/api/EndpointApi.types.ts +3 -3
- package/src/endpoints.module.ts +234 -222
- package/types/api/EndpointApi.types.d.ts +3 -3
- package/types/endpoints.module.d.ts +36 -8
package/package.json
CHANGED
package/src/api/BaseEntity.ts
CHANGED
|
@@ -547,6 +547,11 @@ export class BaseEntity<TServerData = any> {
|
|
|
547
547
|
const transformed = this._transformServerData(newData);
|
|
548
548
|
const incoming = (transformed ?? {});
|
|
549
549
|
if (this._serverData && isReactive(this._serverData)) {
|
|
550
|
+
// Delete all existing properties to ensure fields removed on the server are also removed locally
|
|
551
|
+
for (const key of Object.keys(this._serverData)) {
|
|
552
|
+
delete this._serverData[key];
|
|
553
|
+
}
|
|
554
|
+
// Assign new properties
|
|
550
555
|
Object.assign(this._serverData, incoming);
|
|
551
556
|
} else {
|
|
552
557
|
this._serverData = reactive({ ...incoming }) as TServerData & ReactiveData;
|
|
@@ -589,6 +594,14 @@ export class BaseEntity<TServerData = any> {
|
|
|
589
594
|
}
|
|
590
595
|
|
|
591
596
|
_updateDraftPreservingUserChanges(draft: Record<string, any>): void {
|
|
597
|
+
// First, remove keys from draftData that are no longer in the incoming draft
|
|
598
|
+
for (const key of Object.keys(this._draftData || {})) {
|
|
599
|
+
if (!(key in draft)) {
|
|
600
|
+
delete this._draftData[key];
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// Then, update or add keys from the incoming draft (preserving user modifications)
|
|
592
605
|
for (const key of Object.keys(draft)) {
|
|
593
606
|
const current = this._draftData?.[key];
|
|
594
607
|
const initialValue = this._initialDraftData?.[key];
|
|
@@ -2626,7 +2626,7 @@ export interface AddOrganizationData {
|
|
|
2626
2626
|
/**
|
|
2627
2627
|
* Site web
|
|
2628
2628
|
*/
|
|
2629
|
-
url?: string;
|
|
2629
|
+
url?: string | "";
|
|
2630
2630
|
preferences?: {
|
|
2631
2631
|
/**
|
|
2632
2632
|
* Open data (true/false)
|
|
@@ -2744,7 +2744,7 @@ export interface AddProjectData {
|
|
|
2744
2744
|
/**
|
|
2745
2745
|
* Site web
|
|
2746
2746
|
*/
|
|
2747
|
-
url?: string;
|
|
2747
|
+
url?: string | "";
|
|
2748
2748
|
preferences?: {
|
|
2749
2749
|
/**
|
|
2750
2750
|
* Open data (true/false)
|
|
@@ -3040,7 +3040,7 @@ export interface AddEventData {
|
|
|
3040
3040
|
/**
|
|
3041
3041
|
* Site web
|
|
3042
3042
|
*/
|
|
3043
|
-
url?: string;
|
|
3043
|
+
url?: string | "";
|
|
3044
3044
|
/**
|
|
3045
3045
|
* Email de l’organisation
|
|
3046
3046
|
*/
|