mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 01:01:11 +03:00
Feature/extract import all (#2796)
* use existing route to get all chatflows * add export all chatflows functionality * add read exported all chatflows json file functionality * add save chatflows functionality in server * chore rename saveChatflows to importChatflows and others * chore rewrite snackbar message * fix import chatflows when no data in chatflows db * add handle when import file array length is 0 * chore update and add meaning comment in importChatflows * update method of storing flowdata for importChatflows function * Refresh/redirect to chatflows when import is successful * fix lint --------- Co-authored-by: Ilango <rajagopalilango@gmail.com>
This commit is contained in:
@@ -340,6 +340,18 @@ export const getFolderName = (base64ArrayStr) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const sanitizeChatflows = (arrayChatflows) => {
|
||||
const sanitizedChatflows = arrayChatflows.map((chatFlow) => {
|
||||
const sanitizeFlowData = generateExportFlowData(JSON.parse(chatFlow.flowData))
|
||||
return {
|
||||
id: chatFlow.id,
|
||||
name: chatFlow.name,
|
||||
flowData: JSON.stringify(sanitizeFlowData, null, 2)
|
||||
}
|
||||
})
|
||||
return sanitizedChatflows
|
||||
}
|
||||
|
||||
export const generateExportFlowData = (flowData) => {
|
||||
const nodes = flowData.nodes
|
||||
const edges = flowData.edges
|
||||
|
||||
Reference in New Issue
Block a user