fix(import): route member CSV import through the server action (security/data)

The members branch was inserting space_members directly from the
browser with user_id: crypto.randomUUID() -- a fabricated id that
violates the auth.users FK (offline members must be user_id NULL) and
bypassed all server-side validation. Now maps columns and calls the
existing admin-gated, Zod-validated, batched importMembers action;
surfaces count + skipped. Dropped the now-unused spaceId prop.
This commit is contained in:
Moheeb Zara
2026-05-17 01:18:05 -07:00
parent 363e2a667f
commit 7054b35ddb
2 changed files with 34 additions and 39 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ export default async function ImportPage() {
<PageTitle>Import & Sync</PageTitle>
<p className="font-mono text-xs text-sidebar-foreground/50">CSV import · member & payment data</p>
</div>
<ImportClient spaceId={member!.space_id} role={member!.role} />
<ImportClient role={member!.role} />
</div>
)
}