From c201115a1f4f8acdb768507ae9f5583b2349f7e7 Mon Sep 17 00:00:00 2001 From: Barkley Trimsworth Date: Sat, 28 Mar 2026 13:19:56 +0000 Subject: [PATCH] fix(portal): add missing drizzle-orm operators and fix staffId type - Import lt, gt, ne from @groombook/db alongside existing eq/and - Add non-null assertion on appt.staffId since appointment always has staffId Co-Authored-By: Paperclip --- apps/api/src/routes/portal.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/routes/portal.ts b/apps/api/src/routes/portal.ts index bad0fa2..9335c5d 100644 --- a/apps/api/src/routes/portal.ts +++ b/apps/api/src/routes/portal.ts @@ -1,7 +1,7 @@ import { Hono } from "hono"; import { zValidator } from "@hono/zod-validator"; import { z } from "zod/v3"; -import { and, eq, getDb, appointments, impersonationSessions, waitlistEntries } from "@groombook/db"; +import { and, eq, lt, gt, ne, getDb, appointments, impersonationSessions, waitlistEntries } from "@groombook/db"; import type { AppEnv } from "../middleware/rbac.js"; export const portalRouter = new Hono(); @@ -277,7 +277,7 @@ portalRouter.post( .from(appointments) .where( and( - eq(appointments.staffId, appt.staffId), + eq(appointments.staffId, appt.staffId!), lt(appointments.startTime, newEnd), gt(appointments.endTime, newStart), ne(appointments.status, "cancelled"),