Spaces:
Runtime error
Runtime error
feat: Implement product moderation actions, enhance product card display with video snapshots, and introduce new showcase components.
900ee77 | "use server"; | |
| import { auth } from "@/lib/auth"; | |
| import { headers } from "next/headers"; | |
| import { ShowcaseService } from "../services/showcase.service"; | |
| import { revalidatePath } from "next/cache"; | |
| export async function triggerAnalysisAction(videoId: string) { | |
| const session = await auth.api.getSession({ | |
| headers: await headers() | |
| }); | |
| // We allow anonymous triggering for now as per ingestion rules | |
| const userId = session?.user?.id || null; | |
| if (!videoId) return { success: false, error: "Video ID is required" }; | |
| console.log(`[triggerAnalysisAction] Triggering analysis for ${videoId}...`); | |
| const result = await ShowcaseService.ingestAndAnalyze(videoId, userId, { skipAnalysis: false }); | |
| if (result.success) { | |
| revalidatePath(`/showcase/${videoId}`); | |
| } | |
| return result; | |
| } | |