Skip to content

Commit 699cc0c

Browse files
committed
fix(org-signup): mark user.profileComplete=true after org profile creation; fix Spaces upload block; reset prod DB separately
1 parent 3465e32 commit 699cc0c

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

app/api/signup/organization/profile/route.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ export async function POST(req: Request) {
7777
CacheControl: "public, max-age=31536000, immutable",
7878
ACL: process.env.DO_SPACES_PUBLIC === "true" ? "public-read" : undefined,
7979
})
80-
)
81-
80+
);
8281
const endpointHost = new URL(process.env.DO_SPACES_ENDPOINT!).host
8382
const baseCdn = process.env.NEXT_PUBLIC_SPACES_CDN?.replace(/\/$/, "")
8483
uploadedLogoUrl = baseCdn
@@ -95,14 +94,19 @@ export async function POST(req: Request) {
9594
await prisma.organization.create({
9695
data: {
9796
name,
98-
industry: field,
9997
email: session.user.email ?? null,
10098
website: website || null,
10199
slug,
102100
logoUrl: uploadedLogoUrl,
103101
},
104102
});
105103

104+
// Mark the user's profile as complete for ORGANIZATION accounts
105+
await prisma.user.update({
106+
where: { id: session.user.id },
107+
data: { profileComplete: true },
108+
});
109+
106110
return NextResponse.json({ ok: true });
107111
} catch (err) {
108112
console.error("POST /api/signup/organization/profile error", err);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Set profileComplete = true for all users
2+
update "User"
3+
set "profileComplete" = true
4+
where "profileComplete" = false;

0 commit comments

Comments
 (0)