fix(portal): wire dev client login to portal session #184

Merged
groombook-engineer[bot] merged 4 commits from fix/gro-300-dev-client-portal-auth into main 2026-03-30 18:25:01 +00:00
Showing only changes of commit 853c55fd04 - Show all commits
+3 -3
View File
@@ -65,7 +65,7 @@ staffRouter.patch("/:id", zValidator("json", updateStaffSchema), async (c) => {
const superUserCount = await db
.select({ id: staff.id })
.from(staff)
.where(eq(staff.isSuperUser, true))
.where(and(eq(staff.isSuperUser, true), eq(staff.active, true)))
.limit(2); // just need count; fetch 2 to know if > 1
if (superUserCount.length <= 1) {
return c.json(
@@ -86,7 +86,7 @@ staffRouter.patch("/:id", zValidator("json", updateStaffSchema), async (c) => {
const superUserCount = await db
.select({ id: staff.id })
.from(staff)
.where(eq(staff.isSuperUser, true))
.where(and(eq(staff.isSuperUser, true), eq(staff.active, true)))
.limit(2);
if (superUserCount.length <= 1) {
return c.json(
@@ -142,7 +142,7 @@ staffRouter.delete("/:id", async (c) => {
const superUserCount = await db
.select({ id: staff.id })
.from(staff)
.where(eq(staff.isSuperUser, true))
.where(and(eq(staff.isSuperUser, true), eq(staff.active, true)))
.limit(2);
if (superUserCount.length <= 1) {
return c.json(