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 <noreply@paperclip.ing>
This commit is contained in:
groombook-ci[bot]
2026-03-28 21:13:45 +00:00
committed by Flea Flicker
parent 21df02eef8
commit 2ccd42736a
+2 -2
View File
@@ -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);