first commit

This commit is contained in:
2026-07-17 21:48:37 +05:30
commit f85599dac5
124 changed files with 10775 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { NextRequest, NextResponse } from "next/server";
import { getBackend } from "@/lib/backend";
export const dynamic = "force-dynamic";
export async function GET() {
return NextResponse.json({ channels: await getBackend().listChannels() });
}
// POST /api/bff/channels — create a channel or DM
export async function POST(req: NextRequest) {
const body = await req.json().catch(() => ({}));
const channel = await getBackend().createChannel({
name: String(body.name ?? "new-channel"),
kind: body.kind,
topic: body.topic,
memberIds: body.memberIds,
});
return NextResponse.json({ channel }, { status: 201 });
}