MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / updateDataset

Function updateDataset

packages/server/src/controllers/dataset/index.ts:65–85  ·  view source on GitHub ↗
(req: Request, res: Response, next: NextFunction)

Source from the content-addressed store, hash-verified

63}
64
65const updateDataset = async (req: Request, res: Response, next: NextFunction) => {
66 try {
67 if (!req.body) {
68 throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: datasetService.updateDataset - body not provided!`)
69 }
70 if (typeof req.params === 'undefined' || !req.params.id) {
71 throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: datasetService.updateDataset - id not provided!`)
72 }
73 const workspaceId = req.user?.activeWorkspaceId
74 if (!workspaceId) {
75 throw new InternalFlowiseError(
76 StatusCodes.NOT_FOUND,
77 `Error: datasetController.updateDataset - workspace ${workspaceId} not found!`
78 )
79 }
80 const apiResponse = await datasetService.updateDataset(req.params.id, stripProtectedFields(req.body), workspaceId)
81 return res.json(apiResponse)
82 } catch (error) {
83 next(error)
84 }
85}
86
87const deleteDataset = async (req: Request, res: Response, next: NextFunction) => {
88 try {

Callers

nothing calls this directly

Calls 1

stripProtectedFieldsFunction · 0.90

Tested by

no test coverage detected