From 7fdb32f95b3119fccc63fa0776431f6009756b02 Mon Sep 17 00:00:00 2001 From: Barkley Trimsworth Date: Mon, 30 Mar 2026 13:55:00 +0000 Subject: [PATCH] =?UTF-8?q?fix(GRO-206):=20CTO=20review=20fixes=20?= =?UTF-8?q?=E2=80=94=20active=20filter=20on=20super=20user=20count=20+=20C?= =?UTF-8?q?I=20TAG=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add active=true filter to all 3 super user count queries in staff.ts (revoke, deactivate, delete) so inactive super users aren't counted - Fix ci.yml deploy step: use steps.version.outputs.tag instead of invalid github.sha::7 expression - Remove GRO-206 CI trigger junk line from README.md Co-Authored-By: Paperclip --- .github/workflows/ci.yml | 2 +- README.md | 1 - apps/api/src/routes/staff.ts | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9557c1..0cd237f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -212,7 +212,7 @@ jobs: - name: Deploy to groombook-dev env: - TAG: pr-${{ github.event.pull_request.number }}-${{ github.sha::7 }} + TAG: ${{ steps.version.outputs.tag }} PR_NUM: ${{ github.event.pull_request.number }} run: | echo "Deploying images tagged $TAG to groombook-dev..." diff --git a/README.md b/README.md index a73b3ba..31b725d 100644 --- a/README.md +++ b/README.md @@ -215,4 +215,3 @@ All PRs require CI to pass before merge. See [CONTRIBUTING.md](./CONTRIBUTING.md ## License AGPL-3.0 -# GRO-206 CI trigger diff --git a/apps/api/src/routes/staff.ts b/apps/api/src/routes/staff.ts index 7a4a8b5..bf5c8c2 100644 --- a/apps/api/src/routes/staff.ts +++ b/apps/api/src/routes/staff.ts @@ -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(