diff --git a/app/api/public/visit/route.ts b/app/api/public/visit/route.ts deleted file mode 100644 index 1af4d96..0000000 --- a/app/api/public/visit/route.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NextRequest, NextResponse } from 'next/server'; -import { db, guests } from '@/lib/db'; -import { USR_COOKIE, buildCookie, isSecureCookie } from '@/lib/auth/cookies'; - -const ONE_YEAR = 60 * 60 * 24 * 365; - -export async function POST(request: NextRequest) { - const [row] = await db.insert(guests).values({ name: 'Visitante' }).returning(); - const headers = new Headers(); - headers.append('Set-Cookie', buildCookie(USR_COOKIE, row.id, isSecureCookie(request), ONE_YEAR)); - return NextResponse.json({ success: true, guestId: row.id }, { headers }); -} diff --git a/app/page.tsx b/app/page.tsx index 9bc2d96..dd65557 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -83,24 +83,13 @@ export default function HomePage() { ); } - const onVisit = async () => { - await fetch('/api/public/visit', { method: 'POST', credentials: 'include' }); - router.replace('/'); - }; - return (

Lista de Presentes

-

+

Gerencie listas de presentes e convites com facilidade.

-
);