### What problem does this PR solve? Feat: Exclude operator_permission field from renaming chat fields #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
23d0b564d3
commit
e40be8e541
3 changed files with 7 additions and 4 deletions
|
|
@ -2,7 +2,6 @@ import { Toaster as Sonner } from '@/components/ui/sonner';
|
||||||
import { Toaster } from '@/components/ui/toaster';
|
import { Toaster } from '@/components/ui/toaster';
|
||||||
import i18n from '@/locales/config';
|
import i18n from '@/locales/config';
|
||||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
|
||||||
import { App, ConfigProvider, ConfigProviderProps, theme } from 'antd';
|
import { App, ConfigProvider, ConfigProviderProps, theme } from 'antd';
|
||||||
import pt_BR from 'antd/lib/locale/pt_BR';
|
import pt_BR from 'antd/lib/locale/pt_BR';
|
||||||
import deDE from 'antd/locale/de_DE';
|
import deDE from 'antd/locale/de_DE';
|
||||||
|
|
@ -85,7 +84,7 @@ function Root({ children }: React.PropsWithChildren) {
|
||||||
<Sonner position={'top-right'} expand richColors closeButton></Sonner>
|
<Sonner position={'top-right'} expand richColors closeButton></Sonner>
|
||||||
<Toaster />
|
<Toaster />
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
<ReactQueryDevtools buttonPosition={'top-left'} initialIsOpen={false} />
|
{/* <ReactQueryDevtools buttonPosition={'top-left'} initialIsOpen={false} /> */}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import {
|
||||||
setLLMSettingEnabledValues,
|
setLLMSettingEnabledValues,
|
||||||
} from '@/utils/form';
|
} from '@/utils/form';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
|
import { omit } from 'lodash';
|
||||||
import { X } from 'lucide-react';
|
import { X } from 'lucide-react';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
|
|
@ -69,7 +70,7 @@ export function ChatSettings({ switchSettingVisible }: ChatSettingsProps) {
|
||||||
? await transformFile2Base64(icon[0])
|
? await transformFile2Base64(icon[0])
|
||||||
: '';
|
: '';
|
||||||
setDialog({
|
setDialog({
|
||||||
...data,
|
...omit(data, 'operator_permission'),
|
||||||
...nextValues,
|
...nextValues,
|
||||||
icon: avatar,
|
icon: avatar,
|
||||||
dialog_id: id,
|
dialog_id: id,
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,10 @@ export const useRenameChat = () => {
|
||||||
const nextChat = {
|
const nextChat = {
|
||||||
...(isEmpty(chat)
|
...(isEmpty(chat)
|
||||||
? InitialData
|
? InitialData
|
||||||
: { ...omit(chat, 'nickname', 'tenant_avatar'), dialog_id: chat.id }),
|
: {
|
||||||
|
...omit(chat, 'nickname', 'tenant_avatar', 'operator_permission'),
|
||||||
|
dialog_id: chat.id,
|
||||||
|
}),
|
||||||
name,
|
name,
|
||||||
};
|
};
|
||||||
const ret = await setDialog(nextChat);
|
const ret = await setDialog(nextChat);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue