This commit is contained in:
2025-06-09 19:04:42 +05:00
parent 9d53a971ee
commit 90edf5e550
4 changed files with 18 additions and 13 deletions
+4 -6
View File
@@ -16,15 +16,13 @@ export const commentsController = new Elysia({ prefix: "comments" })
}
)
.post(
"/:sessionId",
async ({ params: { sessionId }, auth: { userId }, body: { text } }) =>
await createComment(sessionId, userId, text),
"/",
async ({ auth: { userId }, body: { text, sessionId } }) =>
await createComment({ userId, text, sessionId }),
{
params: t.Object({
sessionId: t.String(),
}),
body: t.Object({
text: t.String(),
sessionId: t.String(),
}),
}
);