Files
ragflow/web/src/services/mcp-server-service.ts
balibabu 4cf4d444d2 Fix: Login page type error. (#14156)
### What problem does this PR solve?

Fix: Login page type error.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
2026-04-16 18:46:52 +08:00

58 lines
1.1 KiB
TypeScript

import { IPaginationRequestBody } from '@/interfaces/request/base';
import api from '@/utils/api';
import registerServer from '@/utils/register-server';
import request from '@/utils/request';
const {
listMcpServer,
createMcpServer,
updateMcpServer,
deleteMcpServer,
getMcpServer,
importMcpServer,
exportMcpServer,
testMcpServer,
} = api;
const methods = {
list: {
url: listMcpServer,
method: 'post',
},
get: {
url: getMcpServer,
method: 'get',
},
create: {
url: createMcpServer,
method: 'post',
},
update: {
url: updateMcpServer,
method: 'post',
},
delete: {
url: deleteMcpServer,
method: 'post',
},
import: {
url: importMcpServer,
method: 'post',
},
export: {
url: exportMcpServer,
method: 'post',
},
test: {
url: testMcpServer,
method: 'post',
},
} as const;
const mcpServerService = registerServer<keyof typeof methods>(methods, request);
export default mcpServerService;
export const listMcpServers = (params?: IPaginationRequestBody, body?: any) =>
request.post(api.listMcpServer, { data: body || {}, params });