mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: Delete the files uploaded in the external dialog box #1880 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -41,6 +41,7 @@ export default {
|
||||
get_document_list: `${api_host}/document/list`,
|
||||
document_change_status: `${api_host}/document/change_status`,
|
||||
document_rm: `${api_host}/document/rm`,
|
||||
document_delete: `${api_host}/api/document`,
|
||||
document_rename: `${api_host}/document/rename`,
|
||||
document_create: `${api_host}/document/create`,
|
||||
document_run: `${api_host}/document/run`,
|
||||
|
||||
@ -6,6 +6,8 @@ type Service<T extends string> = Record<
|
||||
(params?: any, urlAppendix?: string) => any
|
||||
>;
|
||||
|
||||
const Methods = ['post', 'delete', 'put'];
|
||||
|
||||
const registerServer = <T extends string>(
|
||||
opt: Record<T, { url: string; method: string }>,
|
||||
request: RequestMethod,
|
||||
@ -18,7 +20,7 @@ const registerServer = <T extends string>(
|
||||
if (urlAppendix) {
|
||||
url = url + '/' + urlAppendix;
|
||||
}
|
||||
if (opt[key].method === 'post' || opt[key].method === 'POST') {
|
||||
if (Methods.some((x) => x === opt[key].method.toLowerCase())) {
|
||||
return request(url, {
|
||||
method: opt[key].method,
|
||||
data: params,
|
||||
|
||||
Reference in New Issue
Block a user