Refactor: Standardize naming convention to camelCase (#14079)

### What problem does this PR solve?

Refactor: Standardize naming convention to camelCase

### Type of change

- [x] Refactoring
This commit is contained in:
chanx
2026-04-13 21:07:07 +08:00
committed by GitHub
parent 9a38af7cbf
commit 6ffa566ec3
13 changed files with 200 additions and 196 deletions

View File

@@ -47,7 +47,7 @@ export const useDeleteChunk = () => {
} = useMutation({
mutationKey: ['deleteChunk'],
mutationFn: async (params: { chunkIds: string[]; doc_id: string }) => {
const { data } = await kbService.rm_chunk(params);
const { data } = await kbService.rmChunk(params);
if (data.code === 0) {
setPaginationParams(1);
queryClient.invalidateQueries({ queryKey: ['fetchChunkList'] });
@@ -70,9 +70,9 @@ export const useCreateChunk = () => {
} = useMutation({
mutationKey: ['createChunk'],
mutationFn: async (payload: any) => {
let service = kbService.create_chunk;
let service = kbService.createChunk;
if (payload.chunk_id) {
service = kbService.set_chunk;
service = kbService.setChunk;
}
const { data } = await service(payload);
if (data.code === 0) {
@@ -95,7 +95,7 @@ export const useFetchChunk = (chunkId?: string): ResponseType<any> => {
initialData: {},
gcTime: 0,
queryFn: async () => {
const data = await kbService.get_chunk({
const data = await kbService.getChunk({
chunk_id: chunkId,
});
@@ -138,7 +138,7 @@ export const useFetchNextChunkList = (
gcTime: 0,
enabled,
queryFn: async () => {
const { data } = await kbService.chunk_list({
const { data } = await kbService.chunkList({
doc_id: documentId,
page: pagination.current,
size: pagination.pageSize,
@@ -206,7 +206,7 @@ export const useSwitchChunk = () => {
available_int?: number;
doc_id: string;
}) => {
const { data } = await kbService.switch_chunk(params);
const { data } = await kbService.switchChunk(params);
if (data.code === 0) {
message.success(t('message.modified'));
}