From e45c253344005e2873989586aa058ebca8bd9214 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 04:44:04 +0000 Subject: [PATCH] feat: add type assertions for zValidator request handling Co-Authored-By: Dallin Bentley --- apps/server/src/api/v2/slack/initiate-oauth.ts | 3 ++- apps/server/src/api/v2/slack/update-integration.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/server/src/api/v2/slack/initiate-oauth.ts b/apps/server/src/api/v2/slack/initiate-oauth.ts index 50f09e4ec..c3369f3de 100644 --- a/apps/server/src/api/v2/slack/initiate-oauth.ts +++ b/apps/server/src/api/v2/slack/initiate-oauth.ts @@ -1,5 +1,6 @@ import { getUserOrganizationId } from '@buster/database'; import { + type InitiateOAuthRequest, type InitiateOAuthResponse, InitiateOAuthResponseSchema, SlackError, @@ -45,7 +46,7 @@ export async function initiateOAuthHandler(c: Context): Promise { throw new HTTPException(400, { message: 'Organization not found' }); } - const request = c.req.valid('json'); + const request = c.req.valid('json') as InitiateOAuthRequest; const metadata = request?.metadata; const enrichedMetadata = { diff --git a/apps/server/src/api/v2/slack/update-integration.ts b/apps/server/src/api/v2/slack/update-integration.ts index 1b47ec5fd..526ba3a96 100644 --- a/apps/server/src/api/v2/slack/update-integration.ts +++ b/apps/server/src/api/v2/slack/update-integration.ts @@ -1,6 +1,7 @@ import { getUserOrganizationId } from '@buster/database'; import { SlackError, + type UpdateIntegrationRequest, type UpdateIntegrationResponse, UpdateIntegrationResponseSchema, } from '@buster/server-shared/slack'; @@ -22,7 +23,7 @@ export async function updateIntegrationHandler(c: Context): Promise { } try { - const request = c.req.valid('json'); + const request = c.req.valid('json') as UpdateIntegrationRequest; const updateData: { defaultChannel?: { id: string; name: string };