Fix bun-types resolution; fix possibly-undefined health-check row

Same bun-types-vs-@types/bun fix as continuum-common. Also fixes a real
noUncheckedIndexedAccess violation in the /health route: db.execute()'s
result is T[], so rows[0] is 'T | undefined', not T — destructuring assumed
it always existed. Verified with a clean 'bunx tsc --noEmit'.
This commit is contained in:
2026-08-28 18:28:06 +00:00
parent 4d13570f0b
commit 401c65762b
3 changed files with 293 additions and 3 deletions
+2 -2
View File
@@ -14,9 +14,9 @@ const app = new Elysia()
.use(cors())
.use(swagger({ path: "/docs" }))
.get("/health", async () => {
const [{ ok }] = await db.execute<{ ok: number }>(sql`select 1 as ok`);
const rows = await db.execute<{ ok: number }>(sql`select 1 as ok`);
const redisPing = await redis.ping();
return { status: "ok", db: ok === 1, redis: redisPing === "PONG" };
return { status: "ok", db: rows[0]?.ok === 1, redis: redisPing === "PONG" };
})
.use(authRoutes)
.use(farmRoutes)