@kumori/aurora-backend-handler 1.0.33 → 1.0.34
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 +1 -1
- package/websocket-manager.ts +31 -1
package/package.json
CHANGED
package/websocket-manager.ts
CHANGED
|
@@ -784,11 +784,36 @@ const handleEvent = async (message: WSMessage) => {
|
|
|
784
784
|
break;
|
|
785
785
|
|
|
786
786
|
case "tenant":
|
|
787
|
+
const existingTenant = tenantsMap.get(entityId);
|
|
787
788
|
const newTenant: Tenant = handleTenantEvent(
|
|
788
789
|
entityId,
|
|
789
790
|
eventData,
|
|
790
791
|
userData,
|
|
791
792
|
);
|
|
793
|
+
if (existingTenant) {
|
|
794
|
+
if (
|
|
795
|
+
!newTenant.resources?.length &&
|
|
796
|
+
existingTenant.resources?.length
|
|
797
|
+
) {
|
|
798
|
+
newTenant.resources = existingTenant.resources;
|
|
799
|
+
}
|
|
800
|
+
if (!newTenant.registry?.length && existingTenant.registry?.length) {
|
|
801
|
+
newTenant.registry = existingTenant.registry;
|
|
802
|
+
}
|
|
803
|
+
if (!newTenant.services?.length && existingTenant.services?.length) {
|
|
804
|
+
newTenant.services = existingTenant.services;
|
|
805
|
+
}
|
|
806
|
+
if (
|
|
807
|
+
!newTenant.environments?.length &&
|
|
808
|
+
existingTenant.environments?.length
|
|
809
|
+
) {
|
|
810
|
+
newTenant.environments = existingTenant.environments;
|
|
811
|
+
}
|
|
812
|
+
if (!newTenant.projects?.length && existingTenant.projects?.length) {
|
|
813
|
+
newTenant.projects = existingTenant.projects;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
792
817
|
tenantsMap.set(entityId, newTenant);
|
|
793
818
|
loadMarketplaceItemsForTenant(entityId, "") //TODO Move to helper
|
|
794
819
|
.then((items) => {
|
|
@@ -1131,7 +1156,12 @@ const handleOperationSuccess = (operation: PendingOperation, response: any) => {
|
|
|
1131
1156
|
tenantsMap.set(entityName, newTenant);
|
|
1132
1157
|
eventHelper.tenant.publish.created(newTenant);
|
|
1133
1158
|
} else if (action === "UPDATE") {
|
|
1134
|
-
const
|
|
1159
|
+
const existingTenant = tenantsMap.get(entityName);
|
|
1160
|
+
const updatedTenant = {
|
|
1161
|
+
...existingTenant,
|
|
1162
|
+
...originalData,
|
|
1163
|
+
status: "active",
|
|
1164
|
+
};
|
|
1135
1165
|
tenantsMap.set(entityName, updatedTenant);
|
|
1136
1166
|
eventHelper.tenant.publish.updated(updatedTenant);
|
|
1137
1167
|
}
|