mirror of
https://github.com/langgenius/dify.git
synced 2026-02-22 19:15:47 +08:00
fix: upload folder support parent_id
This commit is contained in:
@ -134,6 +134,7 @@ export function useCreateOperations({
|
||||
appId,
|
||||
tree,
|
||||
files: fileMap,
|
||||
parentId,
|
||||
})
|
||||
|
||||
Toast.notify({
|
||||
|
||||
@ -318,16 +318,18 @@ export const useBatchUpload = () => {
|
||||
appId,
|
||||
tree,
|
||||
files,
|
||||
parentId,
|
||||
onProgress,
|
||||
}: {
|
||||
appId: string
|
||||
tree: BatchUploadNodeInput[]
|
||||
files: Map<string, File>
|
||||
parentId?: string | null
|
||||
onProgress?: (uploaded: number, total: number) => void
|
||||
}): Promise<void> => {
|
||||
const response = await consoleClient.appAsset.batchUpload({
|
||||
params: { appId },
|
||||
body: { children: tree },
|
||||
body: { children: tree, parent_id: parentId },
|
||||
})
|
||||
|
||||
const uploadTasks: Array<{ path: string, file: File, url: string }> = []
|
||||
|
||||
@ -178,6 +178,7 @@ export type BatchUploadNodeOutput = {
|
||||
* Request payload for batch upload
|
||||
*/
|
||||
export type BatchUploadPayload = {
|
||||
parent_id?: string | null
|
||||
children: BatchUploadNodeInput[]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user