mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-30 23:28:52 +01:00
👁️🗨️ refactor: use PermissionBits.VIEW in useAgentsMap for requiredPermission
This commit is contained in:
parent
803ade8601
commit
b742c8c7f9
7 changed files with 32 additions and 36 deletions
|
|
@ -7,12 +7,8 @@ import type { UseMutationResult, QueryObserverResult } from '@tanstack/react-que
|
|||
import type { Agent, AgentCreateParams } from 'librechat-data-provider';
|
||||
import type { TAgentCapabilities, AgentForm } from '~/common';
|
||||
import { cn, createProviderOption, processAgentOption, getDefaultAgentFormValues } from '~/utils';
|
||||
import {
|
||||
useAgentListingDefaultPermissionLevel,
|
||||
useGetStartupConfig,
|
||||
useListAgentsQuery,
|
||||
} from '~/data-provider';
|
||||
import { useLocalize } from '~/hooks';
|
||||
import { useGetStartupConfig, useListAgentsQuery } from '~/data-provider';
|
||||
import { useLocalize, useAgentDefaultPermissionLevel } from '~/hooks';
|
||||
|
||||
const keys = new Set(Object.keys(defaultAgentFormValues));
|
||||
|
||||
|
|
@ -32,7 +28,7 @@ export default function AgentSelect({
|
|||
const { control, reset } = useFormContext();
|
||||
|
||||
const { data: startupConfig } = useGetStartupConfig();
|
||||
const permissionLevel = useAgentListingDefaultPermissionLevel();
|
||||
const permissionLevel = useAgentDefaultPermissionLevel();
|
||||
|
||||
const { data: agents = null } = useListAgentsQuery(
|
||||
{ requiredPermission: permissionLevel },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue