import { defineEndpoint } from "@wrnexus/core"; import type { Context } from "@wrnexus/core"; const ALL = [ { name: "Ajay", designation: "UI" }, { name: "Asha", designation: "Backend" }, { name: "Chen", designation: "UI" }, ]; export const POST = async (ctx: Context) => { const body = (await ctx.req.json().catch(() => ({}))) as { name?: string }; const needle = String(body.name ?? "").toLowerCase(); return Response.json({ users: ALL.filter((user) => user.name.toLowerCase().includes(needle)) }); };