fix(gro66): E2E selector ambiguity in impersonation.spec.ts #128

Merged
groombook-engineer[bot] merged 10 commits from fix/gro66-e2e-selector into main 2026-03-27 14:23:19 +00:00
2 changed files with 10 additions and 2 deletions
Showing only changes of commit d2591e47cd - Show all commits
+2 -2
View File
@@ -73,7 +73,7 @@ appointmentsRouter.get("/", async (c) => {
const to = c.req.query("to");
const staffId = c.req.query("staffId");
const staffRow = c.get("staff");
const isGroomer = staffRow.role === "groomer";
const isGroomer = staffRow?.role === "groomer";
const conditions = [];
if (from) conditions.push(gte(appointments.startTime, new Date(from)));
@@ -108,7 +108,7 @@ appointmentsRouter.get("/", async (c) => {
appointmentsRouter.get("/:id", async (c) => {
const db = getDb();
const staffRow = c.get("staff");
const isGroomer = staffRow.role === "groomer";
const isGroomer = staffRow?.role === "groomer";
const [row] = await db
.select()
.from(appointments)
+8
View File
@@ -134,6 +134,10 @@ portalRouter.post("/appointments/:id/confirm", async (c) => {
.where(eq(appointments.id, id))
.returning();
if (!updated) {
return c.json({ error: "Not found" }, 404);
}
return c.json({
id: updated.id,
confirmationStatus: updated.confirmationStatus,
@@ -194,6 +198,10 @@ portalRouter.post("/appointments/:id/cancel", async (c) => {
.where(eq(appointments.id, id))
.returning();
if (!updated) {
return c.json({ error: "Not found" }, 404);
}
return c.json({
id: updated.id,
status: updated.status,