data
This commit is contained in:
parent
a60cb56ffc
commit
1849dde46e
File diff suppressed because one or more lines are too long
@ -8,7 +8,17 @@ import { NextRequest, NextResponse } from "next/server"
|
||||
*/
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const body = await request.json()
|
||||
const body = await request.json() as {
|
||||
agentId?: string
|
||||
systemPrompt?: string
|
||||
metadata?: {
|
||||
displayName?: string
|
||||
summary?: string
|
||||
tags?: string[]
|
||||
recommendedIcon?: string
|
||||
whenToUse?: string
|
||||
}
|
||||
}
|
||||
const { agentId, systemPrompt, metadata } = body
|
||||
|
||||
// Validate required fields
|
||||
@ -64,7 +74,7 @@ export async function POST(request: NextRequest) {
|
||||
)
|
||||
}
|
||||
|
||||
const result = await n8nResponse.json()
|
||||
const result = await n8nResponse.json() as { promptToken?: string }
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
|
||||
@ -23,7 +23,7 @@ export function useFlags() {
|
||||
throw new Error("Failed to load feature flags")
|
||||
}
|
||||
|
||||
const data = await response.json()
|
||||
const data = await response.json() as { flags?: FeatureFlags }
|
||||
setFlags(data.flags || FLAG_DEFAULTS)
|
||||
} catch (err) {
|
||||
console.error("[useFlags] Error fetching flags:", err)
|
||||
|
||||
@ -24,6 +24,10 @@ Object.defineProperty(window, 'matchMedia', {
|
||||
|
||||
// Mock IntersectionObserver
|
||||
global.IntersectionObserver = class IntersectionObserver {
|
||||
root = null
|
||||
rootMargin = ''
|
||||
thresholds = []
|
||||
|
||||
constructor() {}
|
||||
disconnect() {}
|
||||
observe() {}
|
||||
@ -31,7 +35,7 @@ global.IntersectionObserver = class IntersectionObserver {
|
||||
return []
|
||||
}
|
||||
unobserve() {}
|
||||
}
|
||||
} as any
|
||||
|
||||
// Mock ResizeObserver
|
||||
global.ResizeObserver = class ResizeObserver {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user