mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-23 11:50:14 +01:00
🗨️ refactor: Only Allow Prompt Queries with Access (#9688)
This commit is contained in:
parent
02bfe32905
commit
208be7c06c
8 changed files with 64 additions and 38 deletions
|
|
@ -167,6 +167,7 @@ const PromptForm = () => {
|
|||
const params = useParams();
|
||||
const localize = useLocalize();
|
||||
const { showToast } = useToastContext();
|
||||
const { hasAccess } = usePromptGroupsContext();
|
||||
const alwaysMakeProd = useRecoilValue(store.alwaysMakeProd);
|
||||
const promptId = params.promptId || '';
|
||||
|
||||
|
|
@ -179,10 +180,12 @@ const PromptForm = () => {
|
|||
const [showSidePanel, setShowSidePanel] = useState(false);
|
||||
const sidePanelWidth = '320px';
|
||||
|
||||
const { data: group, isLoading: isLoadingGroup } = useGetPromptGroup(promptId);
|
||||
const { data: group, isLoading: isLoadingGroup } = useGetPromptGroup(promptId, {
|
||||
enabled: hasAccess && !!promptId,
|
||||
});
|
||||
const { data: prompts = [], isLoading: isLoadingPrompts } = useGetPrompts(
|
||||
{ groupId: promptId },
|
||||
{ enabled: !!promptId },
|
||||
{ enabled: hasAccess && !!promptId },
|
||||
);
|
||||
|
||||
const { hasPermission, isLoading: permissionsLoading } = useResourcePermissions(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue