mirror of https://github.com/buster-so/buster.git
fix function name
This commit is contained in:
parent
e2eefbda68
commit
9b99236fa9
|
@ -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,
|
||||||
|
|
|
@ -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];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue