fix: Doc type

This commit is contained in:
Alex
2024-09-08 22:52:09 +01:00
parent 6c0da2ea94
commit 2fce25b0c8
4 changed files with 9 additions and 23 deletions

View File

@@ -8,7 +8,8 @@ import {
selectSourceDocs,
selectSelectedDocs,
} from './preferenceSlice';
import { getDocs, Doc } from './preferenceApi';
import { Doc } from '../models/misc';
import { getDocs } from './preferenceApi';
export default function APIKeyModal({
modalState,
@@ -75,9 +76,7 @@ export default function APIKeyModal({
{!localSelectedDocs ? (
<p className="py-3 text-gray-500">Select</p>
) : (
<p className="py-3">
{localSelectedDocs.name} {localSelectedDocs.version}
</p>
<p className="py-3">{localSelectedDocs.name}</p>
)}
</div>
{isDocsListOpen && (

View File

@@ -1,15 +1,6 @@
import conversationService from '../api/services/conversationService';
import userService from '../api/services/userService';
// not all properties in Doc are going to be present. Make some optional
export type Doc = {
id: string | null;
name: string;
type: string;
date: string;
model: string;
retriever: string;
};
import { Doc } from '../models/misc';
//Fetches all JSON objects from the source. We only use the objects with the "model" property in SelectDocsModal.tsx. Hopefully can clean up the source file later.
export async function getDocs(): Promise<Doc[] | null> {