Add website link to page profile so the AI can read the shop site

Adds PageProfile.website (with migration). Codex runs without network, so
the profile draft route fetches the site server-side (public hosts only,
redirect-checked, size-capped, cached) and passes its text as
<shop_website>. Other prompts receive the URL via the shop profile.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Loma Bot Ops
2026-11-23 21:20:35 +07:00
parent b592cd43f4
commit 5f8f0c9159
16 changed files with 184 additions and 35 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ export async function POST(req: Request) {
// SUPERADMIN passes the role check for any id, so confirm the page exists.
const page = await prisma.page.findUnique({
where: { id: pageId },
select: { profile: { select: { business: true, audience: true, tone: true, visualStyle: true, avoid: true, cta: true } } },
select: { profile: { select: { business: true, audience: true, tone: true, visualStyle: true, avoid: true, cta: true, website: true } } },
});
if (!page) return NextResponse.json({ error: "ไม่พบเพจ" }, { status: 404 });
const profile = page.profile;