diff --git a/apps/server/src/api/v2/chats/services/chat-helpers.ts b/apps/server/src/api/v2/chats/services/chat-helpers.ts index 9f28d1e1b..b9fd30585 100644 --- a/apps/server/src/api/v2/chats/services/chat-helpers.ts +++ b/apps/server/src/api/v2/chats/services/chat-helpers.ts @@ -21,7 +21,7 @@ import { ChatError, ChatErrorCode } from '@buster/server-shared/chats'; import { PostProcessingMessageSchema } from '@buster/server-shared/message'; import { and, eq, gte, isNull } from 'drizzle-orm'; import type { z } from 'zod'; -import { convertChatToAssetChat } from './server-asset-conversion'; +import { convertChatAssetTypeToDatabaseAssetType } from './server-asset-conversion'; /** * Validates a nullable JSONB field against a Zod schema @@ -368,7 +368,7 @@ export async function handleAssetChat( const userId = user.id; try { // Generate asset messages - const assetType = convertChatToAssetChat(chatAssetType); + const assetType = convertChatAssetTypeToDatabaseAssetType(chatAssetType); const assetMessages = await generateAssetMessages({ assetId, assetType, diff --git a/apps/server/src/api/v2/chats/services/server-asset-conversion.ts b/apps/server/src/api/v2/chats/services/server-asset-conversion.ts index b75545304..0a2edfe4d 100644 --- a/apps/server/src/api/v2/chats/services/server-asset-conversion.ts +++ b/apps/server/src/api/v2/chats/services/server-asset-conversion.ts @@ -6,6 +6,8 @@ const chatAssetTypeToDatabaseAssetType: Record dashboard: 'dashboard_file', }; -export const convertChatToAssetChat = (assetType: ChatAssetType): DatabaseAssetType => { +export const convertChatAssetTypeToDatabaseAssetType = ( + assetType: ChatAssetType +): DatabaseAssetType => { return chatAssetTypeToDatabaseAssetType[assetType]; };