diff --git a/package.json b/package.json index 59b8e18f..cfea9908 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.0.0", "cmdk": "^0.2.0", - "drizzle-orm": "0.26.5", + "drizzle-orm": "0.30.9", "drizzle-zod": "0.4.2", "encoding": "^0.1.13", "eslint": "8.37.0", diff --git a/src/app/api/chats/[chatid]/route.tsx b/src/app/api/chats/[chatid]/route.tsx index f05f96c7..4057b9e1 100644 --- a/src/app/api/chats/[chatid]/route.tsx +++ b/src/app/api/chats/[chatid]/route.tsx @@ -18,6 +18,6 @@ export async function GET( const msg = fetchedChat[0].messages; const chatlog = JSON.parse(msg as string) as ChatLog; - console.log("fetchedChat route", chatlog); + // console.log("fetchedChat route", chatlog); return NextResponse.json({ chats: chatlog ? chatlog : [] }); } diff --git a/src/app/api/patentsearch/route.ts b/src/app/api/patentsearch/route.ts index 95fa8c30..390b1c95 100644 --- a/src/app/api/patentsearch/route.ts +++ b/src/app/api/patentsearch/route.ts @@ -55,8 +55,6 @@ export async function POST(request: Request) { chatlog.log.length, ); - console.log("prevChatData", nextChatData); - const res = await axios.get(`${baseUrl}/search/102`, { params: { q: query, @@ -70,6 +68,9 @@ export async function POST(request: Request) { console.log("data", data); + if (data?.length === 0) { + return NextResponse.json({ data: null }, { status: 404 }); + } const patentMessage = { role: "assistant", subRole: "patent-search", @@ -89,7 +90,5 @@ export async function POST(request: Request) { .where(eq(chats.id, Number(chatId))) .run(); - // console.log(data) - return NextResponse.json({ data: updatedChatLog }); } diff --git a/src/components/chat.tsx b/src/components/chat.tsx index a940d291..2171708a 100644 --- a/src/components/chat.tsx +++ b/src/components/chat.tsx @@ -322,7 +322,7 @@ export default function Chat(props: ChatProps) { > )}
- {scrollToBottom()} + {/* {scrollToBottom()} */} ); } diff --git a/src/components/chatmessagecombinator.tsx b/src/components/chatmessagecombinator.tsx index f5e3cbec..d160c7d2 100644 --- a/src/components/chatmessagecombinator.tsx +++ b/src/components/chatmessagecombinator.tsx @@ -60,24 +60,29 @@ const ChatMessageCombinator = ({ const queryClient = useQueryClient(); const sheetContentRef = useRef