Use nullish coalescing in admin users create
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,7 @@ export const adminUsersCreate = os.admin.users.create
|
|||||||
.insertInto("users")
|
.insertInto("users")
|
||||||
.values({
|
.values({
|
||||||
email: normalizedEmail,
|
email: normalizedEmail,
|
||||||
display_name: name || null,
|
display_name: name ?? null,
|
||||||
})
|
})
|
||||||
.returning(["id"])
|
.returning(["id"])
|
||||||
.executeTakeFirstOrThrow();
|
.executeTakeFirstOrThrow();
|
||||||
@@ -55,7 +55,7 @@ export const adminUsersCreate = os.admin.users.create
|
|||||||
.values({
|
.values({
|
||||||
org_id: orgId,
|
org_id: orgId,
|
||||||
user_id: newUser.id,
|
user_id: newUser.id,
|
||||||
role: orgRole || "member",
|
role: orgRole ?? "member",
|
||||||
})
|
})
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user