11 lines
420 B
TypeScript
11 lines
420 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
import { getBackend } from "@/lib/backend";
|
|
import type { InboxState } from "@lynkd/messaging-inbox-sdk";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET(req: NextRequest) {
|
|
const state = (req.nextUrl.searchParams.get("state") as InboxState | null) ?? undefined;
|
|
return NextResponse.json({ items: await getBackend().listInbox(state) });
|
|
}
|