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:
@@ -43,7 +43,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: { pictureUrl: true, profile: { select: { business: true, audience: true, tone: true, visualStyle: true, avoid: true, cta: true } } },
|
||||
select: { pictureUrl: true, profile: { select: { business: true, audience: true, tone: true, visualStyle: true, avoid: true, cta: true, website: true } } },
|
||||
});
|
||||
if (!page) return NextResponse.json({ error: "ไม่พบเพจ" }, { status: 404 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user