From 2ccd42736a5f62334c94509bd40cb7eff42b9cd4 Mon Sep 17 00:00:00 2001 From: "groombook-ci[bot]" Date: Sat, 28 Mar 2026 21:13:45 +0000 Subject: [PATCH] fix(GRO-213): fix ContentfulStatusCode type error in setup.ts Cast (result.code ?? 500) to ContentfulStatusCode after importing the type from hono. This satisfies the TypeScript overload without using broad 'as number' cast. Co-Authored-By: Paperclip --- apps/api/src/routes/setup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/routes/setup.ts b/apps/api/src/routes/setup.ts index 9236872..b107e59 100644 --- a/apps/api/src/routes/setup.ts +++ b/apps/api/src/routes/setup.ts @@ -1,4 +1,4 @@ -import { Hono } from "hono"; +import { Hono, type ContentfulStatusCode } from "hono"; import { zValidator } from "@hono/zod-validator"; import { z } from "zod/v3"; import { eq, getDb, staff, businessSettings } from "@groombook/db"; @@ -70,7 +70,7 @@ setupRouter.post("/", zValidator("json", setupSchema), async (c) => { }); if ("error" in result) { - return c.json({ error: result.error }, result.code as number); + return c.json({ error: result.error }, (result.code ?? 500) as ContentfulStatusCode); } return c.json({ ok: true, staff: result.staff }, 201);