mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-10 21:09:51 +02:00
Fix document set editor refresh
This commit is contained in:
parent
8c17c77ed9
commit
0369ddef58
@ -11,6 +11,7 @@ import { errorHandlingFetcher, fetcher } from "./fetcher";
|
||||
import { useState } from "react";
|
||||
import { DateRangePickerValue } from "@tremor/react";
|
||||
import { SourceMetadata } from "./search/interfaces";
|
||||
import { EE_ENABLED } from "./constants";
|
||||
|
||||
const CREDENTIAL_URL = "/api/manage/admin/credential";
|
||||
|
||||
@ -114,9 +115,25 @@ EE Only APIs
|
||||
|
||||
const USER_GROUP_URL = "/api/manage/admin/user-group";
|
||||
|
||||
export const useUserGroups = () => {
|
||||
export const useUserGroups = (): {
|
||||
data: UserGroup[] | undefined;
|
||||
isLoading: boolean;
|
||||
error: string;
|
||||
refreshUserGroups: () => void;
|
||||
} => {
|
||||
const swrResponse = useSWR<UserGroup[]>(USER_GROUP_URL, errorHandlingFetcher);
|
||||
|
||||
if (!EE_ENABLED) {
|
||||
return {
|
||||
...{
|
||||
data: [],
|
||||
isLoading: false,
|
||||
error: "",
|
||||
},
|
||||
refreshUserGroups: () => {},
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
...swrResponse,
|
||||
refreshUserGroups: () => mutate(USER_GROUP_URL),
|
||||
|
Loading…
x
Reference in New Issue
Block a user