(body: any)
| 50 | |
| 51 | // Create new Evaluator |
| 52 | const createEvaluator = async (body: any) => { |
| 53 | try { |
| 54 | const appServer = getRunningExpressApp() |
| 55 | const newDs = EvaluatorDTO.toEntity(body) |
| 56 | newDs.workspaceId = body.workspaceId |
| 57 | |
| 58 | const evaluator = appServer.AppDataSource.getRepository(Evaluator).create(newDs) |
| 59 | const result = await appServer.AppDataSource.getRepository(Evaluator).save(evaluator) |
| 60 | return EvaluatorDTO.fromEntity(result) |
| 61 | } catch (error) { |
| 62 | throw new InternalFlowiseError( |
| 63 | StatusCodes.INTERNAL_SERVER_ERROR, |
| 64 | `Error: evaluatorService.createEvaluator - ${getErrorMessage(error)}` |
| 65 | ) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // Update Evaluator |
| 70 | const updateEvaluator = async (id: string, body: any, workspaceId: string) => { |
nothing calls this directly
no test coverage detected