mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-17 11:09:06 +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:
@ -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