feat(avbeat): point forum + auth at av schema, swap newsletter chips to AV verticals
Schema wiring — AV Beat was inheriting a 'bb' default schema from the
original fork. Fixed three call sites so the AV Beat app reads/writes
the av schema unless an explicit NEXT_PUBLIC_SUPABASE_SCHEMA override
is set:
- src/lib/supabase/client.tsx:8 default 'bb' -> 'av'
- src/lib/supabase/server.tsx:11 default 'bb' -> 'av'
- src/app/api/auth/lookup-email/route.ts :31 + :42 hardcoded
.schema('bb') -> .schema('av') so signup lookup hits the
AV-side subscriber tables, not BB's.
Newsletter signup — homepage chips were the BB taxonomy ('Broadcast',
'Post Production', 'Animation', 'AI & Automation', 'Live Production',
'NAB Show'). Swapped for pro-AV verticals that align with the new
forum categories: Conference Rooms & UC, Digital Signage, Live Events
& Staging, Displays & LED, Audio, AV over IP, InfoComm & ISE.
Default selected flipped from 'Broadcast' to 'Conference Rooms & UC'
so the form doesn't pre-select a non-existent value.
This commit is contained in:
@@ -28,7 +28,7 @@ export async function GET(req: NextRequest) {
|
||||
|
||||
// Layer 1 — the rich subscriber registry (95k+ rows)
|
||||
const { data: sub } = await svc
|
||||
.schema("bb")
|
||||
.schema("av")
|
||||
.from("email_subscribers")
|
||||
.select("id, status")
|
||||
.eq("email_domain", email.split("@")[1])
|
||||
@@ -39,7 +39,7 @@ export async function GET(req: NextRequest) {
|
||||
|
||||
// Layer 2 — the lean property-specific list
|
||||
const { data: nl } = await svc
|
||||
.schema("bb")
|
||||
.schema("av")
|
||||
.from("newsletter_subscribers")
|
||||
.select("id")
|
||||
.ilike("email", email)
|
||||
|
||||
@@ -2,17 +2,18 @@
|
||||
import React, { useState, useId } from "react";
|
||||
|
||||
const categories = [
|
||||
"Broadcast",
|
||||
"Post Production",
|
||||
"Animation",
|
||||
"AI & Automation",
|
||||
"Live Production",
|
||||
"NAB Show",
|
||||
"Conference Rooms & UC",
|
||||
"Digital Signage",
|
||||
"Live Events & Staging",
|
||||
"Displays & LED",
|
||||
"Audio",
|
||||
"AV over IP",
|
||||
"InfoComm & ISE",
|
||||
];
|
||||
|
||||
export default function NewsletterSignup() {
|
||||
const [email, setEmail] = useState("");
|
||||
const [selected, setSelected] = useState<string[]>(["Broadcast"]);
|
||||
const [selected, setSelected] = useState<string[]>(["Conference Rooms & UC"]);
|
||||
const [submitted, setSubmitted] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
@@ -5,7 +5,7 @@ export function createClient() {
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
||||
{
|
||||
db: { schema: process.env.NEXT_PUBLIC_SUPABASE_SCHEMA || 'bb' },
|
||||
db: { schema: process.env.NEXT_PUBLIC_SUPABASE_SCHEMA || 'av' },
|
||||
cookies: {
|
||||
getAll() {
|
||||
if (typeof document === 'undefined') return [];
|
||||
|
||||
@@ -8,7 +8,7 @@ export async function createClient() {
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
||||
{
|
||||
db: { schema: process.env.NEXT_PUBLIC_SUPABASE_SCHEMA || 'bb' },
|
||||
db: { schema: process.env.NEXT_PUBLIC_SUPABASE_SCHEMA || 'av' },
|
||||
cookies: {
|
||||
getAll() {
|
||||
return cookieStore.getAll();
|
||||
|
||||
Reference in New Issue
Block a user