fix(web): typecast handle() response in auth/join page to unblock TS build
Some checks failed
CI / Tests / 🧪 Test (push) Has been cancelled

The Hono RPC client loses the response shape on /organizations/:id because
the route has no zod response validator on c.json(). Tactical cast at the
callsite unblocks the web Docker build. Proper fix is to add a
getOrganizationResponseSchema in packages/api and wire it into the route.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-04 22:43:24 +01:00
parent cd389c6bdd
commit d1ea1a0efa

View File

@@ -42,11 +42,16 @@ export default async function JoinPage({
const invitation = await getInvitation({ id: invitationId }); const invitation = await getInvitation({ id: invitationId });
if (invitation) { if (invitation) {
const { organization } = await handle(api.organizations[":id"].$get)({ // tactical typecast: Hono RPC inference loses the response shape on this
// route (no zod validator on the response). Proper fix is to add a
// getOrganizationResponseSchema to packages/api and wire it into the
// route's c.json() call.
const res = (await handle(api.organizations[":id"].$get)({
param: { param: {
id: invitation.organizationId, id: invitation.organizationId,
}, },
}); })) as { organization: Parameters<typeof Invitation>[0]["organization"] | null };
const { organization } = res;
if (!organization) { if (!organization) {
return notFound(); return notFound();