This commit is contained in:
archer
2023-07-18 11:50:16 +08:00
parent f9d83c481f
commit 505aff3dbf
26 changed files with 216 additions and 210 deletions

View File

@@ -20,12 +20,12 @@ import { getErrText } from '@/utils/tools';
import { QuoteItemType } from '@/pages/api/app/modules/kb/search';
const QuoteModal = ({
historyId,
chatId,
contentId,
rawSearch = [],
onClose
}: {
historyId?: string;
chatId?: string;
contentId?: string;
rawSearch?: QuoteItemType[];
onClose: () => void;
@@ -45,8 +45,8 @@ const QuoteModal = ({
refetch,
isLoading
} = useQuery(['getHistoryQuote'], () => {
if (historyId && contentId) {
return getHistoryQuote({ historyId, contentId });
if (chatId && contentId) {
return getHistoryQuote({ chatId, contentId });
}
if (rawSearch.length > 0) {
return rawSearch;
@@ -59,12 +59,12 @@ const QuoteModal = ({
*/
const updateQuoteStatus = useCallback(
async (quoteId: string, sourceText: string) => {
if (!historyId || !contentId) return;
if (!chatId || !contentId) return;
setIsLoading(true);
try {
await updateHistoryQuote({
contentId,
historyId,
chatId,
quoteId,
sourceText
});
@@ -78,7 +78,7 @@ const QuoteModal = ({
}
setIsLoading(false);
},
[contentId, historyId, refetch, setIsLoading, toast]
[contentId, chatId, refetch, setIsLoading, toast]
);
/**