(req: Request, res: Response, next: NextFunction)
| 23 | } |
| 24 | |
| 25 | const 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 | |
| 45 | const createDataset = async (req: Request, res: Response, next: NextFunction) => { |
| 46 | try { |
nothing calls this directly
no test coverage detected