(req: Request, res: Response, next: NextFunction)
| 127 | } |
| 128 | |
| 129 | const updateDatasetRow = async (req: Request, res: Response, next: NextFunction) => { |
| 130 | try { |
| 131 | if (!req.body) { |
| 132 | throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: datasetService.updateDatasetRow - body not provided!`) |
| 133 | } |
| 134 | if (typeof req.params === 'undefined' || !req.params.id) { |
| 135 | throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: datasetService.updateDatasetRow - id not provided!`) |
| 136 | } |
| 137 | const workspaceId = req.user?.activeWorkspaceId |
| 138 | if (!workspaceId) { |
| 139 | throw new InternalFlowiseError( |
| 140 | StatusCodes.NOT_FOUND, |
| 141 | `Error: datasetController.updateDatasetRow - workspace ${workspaceId} not found!` |
| 142 | ) |
| 143 | } |
| 144 | const body = { ...stripProtectedFields(req.body), workspaceId } |
| 145 | const apiResponse = await datasetService.updateDatasetRow(req.params.id, body) |
| 146 | return res.json(apiResponse) |
| 147 | } catch (error) { |
| 148 | next(error) |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | const deleteDatasetRow = async (req: Request, res: Response, next: NextFunction) => { |
| 153 | try { |
nothing calls this directly
no test coverage detected