MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / getDataset

Function getDataset

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

Source from the content-addressed store, hash-verified

23}
24
25const getDataset = async (req: Request, res: Response, next: NextFunction) => {
26 try {
27 if (typeof req.params === 'undefined' || !req.params.id) {
28 throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: datasetService.getDataset - id not provided!`)
29 }
30 const { page, limit } = getPageAndLimitParams(req)
31 const workspaceId = req.user?.activeWorkspaceId
32 if (!workspaceId) {
33 throw new InternalFlowiseError(
34 StatusCodes.NOT_FOUND,
35 `Error: datasetController.getDataset - workspace ${workspaceId} not found!`
36 )
37 }
38 const apiResponse = await datasetService.getDataset(req.params.id, workspaceId, page, limit)
39 return res.json(apiResponse)
40 } catch (error) {
41 next(error)
42 }
43}
44
45const createDataset = async (req: Request, res: Response, next: NextFunction) => {
46 try {

Callers

nothing calls this directly

Calls 1

getPageAndLimitParamsFunction · 0.90

Tested by

no test coverage detected