kovakmedya 19a0e2b11f fix(onboarding): drop createdBy from tenant_settings write + atomic rollback
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.
2026-04-30 03:27:49 +03:00
S
Description
No description provided
5.2 MiB
Languages
TypeScript 99.5%
CSS 0.5%