MCPcopy
hub / github.com/FlowiseAI/Flowise / createDataset

Function createDataset

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

Source from the content-addressed store, hash-verified

43}
44
45const createDataset = async (req: Request, res: Response, next: NextFunction) => {
46 try {
47 if (!req.body) {
48 throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: datasetService.createDataset - body not provided!`)
49 }
50 const workspaceId = req.user?.activeWorkspaceId
51 if (!workspaceId) {
52 throw new InternalFlowiseError(
53 StatusCodes.NOT_FOUND,
54 `Error: datasetController.createDataset - workspace ${workspaceId} not found!`
55 )
56 }
57 const body = { ...stripProtectedFields(req.body), workspaceId }
58 const apiResponse = await datasetService.createDataset(body, workspaceId)
59 return res.json(apiResponse)
60 } catch (error) {
61 next(error)
62 }
63}
64
65const updateDataset = async (req: Request, res: Response, next: NextFunction) => {
66 try {

Callers

nothing calls this directly

Calls 1

stripProtectedFieldsFunction · 0.90

Tested by

no test coverage detected