(req: Request, res: Response, next: NextFunction)
| 6 | import { stripProtectedFields } from '../../utils/stripProtectedFields' |
| 7 | |
| 8 | const getAllDatasets = async (req: Request, res: Response, next: NextFunction) => { |
| 9 | try { |
| 10 | const { page, limit } = getPageAndLimitParams(req) |
| 11 | const workspaceId = req.user?.activeWorkspaceId |
| 12 | if (!workspaceId) { |
| 13 | throw new InternalFlowiseError( |
| 14 | StatusCodes.NOT_FOUND, |
| 15 | `Error: datasetController.getAllDatasets - workspace ${workspaceId} not found!` |
| 16 | ) |
| 17 | } |
| 18 | const apiResponse = await datasetService.getAllDatasets(workspaceId, page, limit) |
| 19 | return res.json(apiResponse) |
| 20 | } catch (error) { |
| 21 | next(error) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | const getDataset = async (req: Request, res: Response, next: NextFunction) => { |
| 26 | try { |
nothing calls this directly
no test coverage detected