mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-06 01:06:28 +08:00
Build decision flow editor and runtime integration
This commit is contained in:
12
server/api/decision-flows/[slug]/runtime.get.ts
Normal file
12
server/api/decision-flows/[slug]/runtime.get.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { createError } from 'h3'
|
||||
import { buildRuntimeDecisionTree } from '../../../services/decisionFlowService'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const slugParam = event.context.params?.slug
|
||||
if (typeof slugParam !== 'string' || !slugParam.trim()) {
|
||||
throw createError({ statusCode: 400, statusMessage: 'Missing flow identifier' })
|
||||
}
|
||||
|
||||
const tree = await buildRuntimeDecisionTree(slugParam.trim())
|
||||
return tree
|
||||
})
|
||||
Reference in New Issue
Block a user