fix function name

This commit is contained in:
Nate Kelley 2025-07-23 23:09:07 -06:00
parent e2eefbda68
commit 9b99236fa9
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 5 additions and 3 deletions

View File

@ -21,7 +21,7 @@ import { ChatError, ChatErrorCode } from '@buster/server-shared/chats';
import { PostProcessingMessageSchema } from '@buster/server-shared/message'; import { PostProcessingMessageSchema } from '@buster/server-shared/message';
import { and, eq, gte, isNull } from 'drizzle-orm'; import { and, eq, gte, isNull } from 'drizzle-orm';
import type { z } from 'zod'; 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 * Validates a nullable JSONB field against a Zod schema
@ -368,7 +368,7 @@ export async function handleAssetChat(
const userId = user.id; const userId = user.id;
try { try {
// Generate asset messages // Generate asset messages
const assetType = convertChatToAssetChat(chatAssetType); const assetType = convertChatAssetTypeToDatabaseAssetType(chatAssetType);
const assetMessages = await generateAssetMessages({ const assetMessages = await generateAssetMessages({
assetId, assetId,
assetType, assetType,

View File

@ -6,6 +6,8 @@ const chatAssetTypeToDatabaseAssetType: Record<ChatAssetType, DatabaseAssetType>
dashboard: 'dashboard_file', dashboard: 'dashboard_file',
}; };
export const convertChatToAssetChat = (assetType: ChatAssetType): DatabaseAssetType => { export const convertChatAssetTypeToDatabaseAssetType = (
assetType: ChatAssetType
): DatabaseAssetType => {
return chatAssetTypeToDatabaseAssetType[assetType]; return chatAssetTypeToDatabaseAssetType[assetType];
}; };