mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Bugfix/Upsert API for file loader (#5096)
* fix upser api for file loader * - Introduced loaderName property in IDocumentStoreUpsertData interface. - Updated upsertDocStore function to utilize loaderName if provided. - Enhanced DocStoreAPIDialog to allow loaderName customization in API requests. - Modified DocumentStoreDetail to display file names when available, improving source formatting logic.
This commit is contained in:
@@ -81,6 +81,7 @@ export interface IDocumentStoreUpsertData {
|
||||
replaceExisting?: boolean
|
||||
createNewDocStore?: boolean
|
||||
docStore?: IDocumentStore
|
||||
loaderName?: string
|
||||
loader?: {
|
||||
name: string
|
||||
config: ICommonObject
|
||||
|
||||
@@ -573,7 +573,8 @@ const _splitIntoChunks = async (appDataSource: DataSource, componentNodes: IComp
|
||||
chatflowid: uuidv4(),
|
||||
appDataSource,
|
||||
databaseEntities,
|
||||
logger
|
||||
logger,
|
||||
processRaw: true
|
||||
}
|
||||
const docNodeInstance = new nodeModule.nodeClass()
|
||||
let docs: IDocument[] = await docNodeInstance.init(nodeData, '', options)
|
||||
@@ -1727,6 +1728,11 @@ const upsertDocStore = async (
|
||||
...newLoader?.config
|
||||
}
|
||||
|
||||
// Override loaderName if it's provided directly in data
|
||||
if (data.loaderName) {
|
||||
loaderName = data.loaderName
|
||||
}
|
||||
|
||||
splitterName = newSplitter?.name ? getComponentLabelFromName(newSplitter?.name) : splitterName
|
||||
splitterId = newSplitter?.name || splitterId
|
||||
splitterConfig = {
|
||||
|
||||
Reference in New Issue
Block a user