( request: FastifyRequestTypebox<typeof CreatePromptSchema>, reply: FastifyReplyTypebox<typeof CreatePromptSchema>, )
| 80 | * @returns {Promise<void>} |
| 81 | */ |
| 82 | export const createPrompt = async ( |
| 83 | request: FastifyRequestTypebox<typeof CreatePromptSchema>, |
| 84 | reply: FastifyReplyTypebox<typeof CreatePromptSchema>, |
| 85 | ) => { |
| 86 | try { |
| 87 | const data = await request.server.orm.getRepository(Prompt).create(request.body).save(); |
| 88 | reply.code(200).send(data); |
| 89 | } catch (e: any) { |
| 90 | Sentry.captureException(e); |
| 91 | reply.code(500).send(e); |
| 92 | } |
| 93 | }; |
| 94 | |
| 95 | /** |
| 96 | * Updates a prompt in the database by its ID. |
nothing calls this directly
no outgoing calls
no test coverage detected