mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-22 22:01:41 +03:00
d2b4ef4aff
* ✨ get all knowledge utils * ✨ add remove knowledge and update router * ✨ new knowledge provider * 🚨 remove eslint -disable * ✨ new useKnowledgeApi * ✨ set up KnowledgeItem * ✨ add KnowledgeTable component in knowledge tab * 🔥 remove DocumentData replaced by KnowledgeItem * 🐛 fix weird characters instead of '/' * 💄 truncate knowledge name * ✨ add DownloadUploadedKnowledge component * ⚰️ unused code * 🏷️ introduce UploadedKnowledge and CrawledKnowledge types * 💄 remove thread * 💄 bin for delete knowledge * 🌐 update wording for knowledge tab * 🔇 remove logs and comments
26 lines
756 B
TypeScript
26 lines
756 B
TypeScript
import { UUID } from "crypto";
|
|
|
|
import { useAxios } from "@/lib/hooks";
|
|
|
|
import {
|
|
deleteKnowledge,
|
|
DeleteKnowledgeInputProps,
|
|
generateSignedUrlKnowledge,
|
|
getAllKnowledge,
|
|
GetAllKnowledgeInputProps,
|
|
} from "./knowledge";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const useKnowledgeApi = () => {
|
|
const { axiosInstance } = useAxios();
|
|
|
|
return {
|
|
getAllKnowledge: async (props: GetAllKnowledgeInputProps) =>
|
|
getAllKnowledge(props, axiosInstance),
|
|
deleteKnowledge: async (props: DeleteKnowledgeInputProps) =>
|
|
deleteKnowledge(props, axiosInstance),
|
|
generateSignedUrlKnowledge: async (props: { knowledgeId: UUID }) =>
|
|
generateSignedUrlKnowledge(props, axiosInstance),
|
|
};
|
|
};
|