19a0e2b11f1233625026fc3b72e1aab6870c4d20
Two fixes triggered by user-reported error 'Invalid document structure: Unknown attribute createdBy' during onboarding: 1) tenant_settings has no createdBy column by design (one row per tenant, creator metadata is redundant). Removed createdBy from the row payload. 2) Made the action atomic: if any step after teams.create fails (row write, prefs, cookie), delete the just-created team using the admin client. Without this, two failed attempts left two orphan teams; reload then redirected the user to /dashboard with no tenant_settings, trapping them. Already cleaned up the two orphan teams via Appwrite MCP.
Description
No description provided
Languages
TypeScript
99.5%
CSS
0.5%