@kumori/aurora-backend-handler 1.1.1 → 1.1.2
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/helpers/user-helper.ts +8 -0
- package/package.json +1 -1
package/helpers/user-helper.ts
CHANGED
|
@@ -34,6 +34,14 @@ export const handleUserEvent = ({
|
|
|
34
34
|
const userId = eventData.id.name;
|
|
35
35
|
const userTenants = Object.keys(eventData.status.tenants);
|
|
36
36
|
const deletedTenantKeys: string[] = [];
|
|
37
|
+
Object.entries(eventData.status.tenants).forEach(([tenantId, tenantInfo]: [string, any]) => {
|
|
38
|
+
if (tenantInfo.status === "rejected") {
|
|
39
|
+
const tenant = tenantsMap.get(tenantId);
|
|
40
|
+
if (tenant) {
|
|
41
|
+
tenantsMap.set(tenantId, { ...tenant, status: "leaving" });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
37
45
|
for (const key of tenantsMap.keys()) {
|
|
38
46
|
if (!userTenants.includes(key)) {
|
|
39
47
|
const tenantToDelete = tenantsMap.get(key);
|