mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +03:00
Feature/export import stage 2 (#3063)
* add export all function * modify exportAll to reuse existing code from other services * modify routes of export-import * add exportAll function into UI * add errorhandler * add importAll Function into UI for ChatFlow * modify importAll Function to import tools * remove appServer variable * modify exportAll to exportData for new requirement in backend * chore modify type camelCase to PascalCase in exportImportService * add import export for variables, assistants, and checkboxes for UI --------- Co-authored-by: Henry <hzj94@hotmail.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { NextFunction, Request, Response } from 'express'
|
||||
import exportImportService from '../../services/export-import'
|
||||
|
||||
const exportData = async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const apiResponse = await exportImportService.exportData(exportImportService.convertExportInput(req.body))
|
||||
return res.json(apiResponse)
|
||||
} catch (error) {
|
||||
next(error)
|
||||
}
|
||||
}
|
||||
|
||||
const importData = async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const importData = req.body
|
||||
await exportImportService.importData(importData)
|
||||
return res.json({ message: 'success' })
|
||||
} catch (error) {
|
||||
next(error)
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
exportData,
|
||||
importData
|
||||
}
|
||||
Reference in New Issue
Block a user