feat(phase3b): orders에 영상화(music_video) 발주 + video-product 조회

This commit is contained in:
2026-07-09 22:53:02 +09:00
parent 853f96b405
commit c9b8d2df5c
2 changed files with 38 additions and 7 deletions

View File

@@ -0,0 +1,16 @@
import { NextResponse } from 'next/server';
import { createClient } from '@/lib/supabase/server';
import { createAdminClient } from '@/lib/supabase/admin';
import { getProductById } from '@/lib/supabase/product-files';
export const runtime = 'nodejs';
export async function GET() {
const supabase = await createClient();
const { data: { user } } = await supabase.auth.getUser();
if (!user) return NextResponse.json({ error: '로그인이 필요합니다.' }, { status: 401 });
const admin = createAdminClient();
const product = await getProductById(admin, 'music_video');
if (!product || !product.is_active) return NextResponse.json({ error: '영상화 상품이 준비 중입니다.' }, { status: 404 });
return NextResponse.json({ product: { id: product.id, name: product.name, price: product.price, is_active: product.is_active } });
}