mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-10-10 21:26:01 +02:00
14 lines
373 B
TypeScript
14 lines
373 B
TypeScript
import { errorHandlingFetcher } from "@/lib/fetcher";
|
|
import { DocumentSet } from "@/lib/types";
|
|
import useSWR, { mutate } from "swr";
|
|
|
|
export const useDocumentSets = () => {
|
|
const url = "/api/manage/document-set";
|
|
const swrResponse = useSWR<DocumentSet[]>(url, errorHandlingFetcher);
|
|
|
|
return {
|
|
...swrResponse,
|
|
refreshDocumentSets: () => mutate(url),
|
|
};
|
|
};
|