This commit is contained in:
+5
-2
@@ -1,4 +1,5 @@
|
||||
import { Hono } from 'hono'
|
||||
import type { Context } from 'hono'
|
||||
import { z } from 'zod'
|
||||
import { config } from '../config'
|
||||
import { agentClient } from '../services/agent-client'
|
||||
@@ -46,7 +47,7 @@ lmsRoutes.use('/lms/*', async (c, next) => {
|
||||
return next()
|
||||
})
|
||||
|
||||
lmsRoutes.post('/lms/platform-sessions', async (c) => {
|
||||
async function createPlatformSession(c: Context) {
|
||||
const body = sessionSchema.safeParse(await c.req.json().catch(() => null))
|
||||
if (!body.success) return c.json({ error: 'invalid_body', issues: body.error.flatten() }, 400)
|
||||
|
||||
@@ -78,7 +79,9 @@ lmsRoutes.post('/lms/platform-sessions', async (c) => {
|
||||
}
|
||||
throw error
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
lmsRoutes.post('/lms/platform-sessions', createPlatformSession)
|
||||
|
||||
lmsRoutes.get('/lms/agents', async (c) => {
|
||||
const accountEmail = c.req.query('accountEmail') || undefined
|
||||
|
||||
Reference in New Issue
Block a user