MCPcopy Create free account
hub / github.com/Writesonic/GPTRouter / createPrompt

Function createPrompt

src/controllers/prompt.controller.ts:82–93  ·  view source on GitHub ↗
(
  request: FastifyRequestTypebox<typeof CreatePromptSchema>,
  reply: FastifyReplyTypebox<typeof CreatePromptSchema>,
)

Source from the content-addressed store, hash-verified

80 * @returns {Promise<void>}
81 */
82export 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected