first commit

This commit is contained in:
AyrisAI
2026-08-20 01:51:59 +03:00
commit 97b83c7fd4
109 changed files with 21215 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { NextResponse, type NextRequest } from "next/server";
import { supabase } from "@/lib/supabase";
type RouteParams = {
params: Promise<{ id: string }>;
};
// Stable QR redirect target (PRD §12) — printed QR codes encode this URL and
// never change; only the row's target_url is updated when domain/slug changes.
export async function GET(_req: NextRequest, { params }: RouteParams) {
const { id } = await params;
const { data } = await supabase.from("qr_codes").select("target_url").eq("id", id).maybeSingle();
if (!data) {
return NextResponse.json({ message: "not found" }, { status: 404 });
}
return NextResponse.redirect(data.target_url, { status: 302 });
}