fix fetchChatDetails return type

This commit is contained in:
CREDO23 2025-10-23 19:26:41 +02:00 committed by thierryverse
parent 05a8bd1be3
commit d2f00fd328

View file

@ -1,5 +1,6 @@
import type { Message } from "@ai-sdk/react";
import { useCallback, useEffect, useState } from "react";
import { Chat, type ChatDetails } from "@/app/dashboard/[search_space_id]/chats/chats-client";
import type { ResearchMode } from "@/components/chat";
import type { Document } from "@/hooks/use-documents";
@ -49,7 +50,7 @@ interface UseChatAPIProps {
export function useChatAPI({ token, search_space_id }: UseChatAPIProps) {
const fetchChatDetails = useCallback(
async (chatId: string) => {
async (chatId: string): Promise<ChatDetails | null> => {
if (!token) return null;
try {