diff --git a/estore/src/app/api/admin/store-status/route.ts b/estore/src/app/api/admin/store-status/route.ts index b096a3f..4cc5291 100644 --- a/estore/src/app/api/admin/store-status/route.ts +++ b/estore/src/app/api/admin/store-status/route.ts @@ -1,18 +1,11 @@ import { NextRequest, NextResponse } from 'next/server' import { getStoreStatus, setStoreStatus } from '@/lib/store-status' -import { cookies } from 'next/headers' - -function isAuthed() { - return cookies().get('bpb_admin')?.value === 'true' -} export async function GET() { - if (!isAuthed()) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) return NextResponse.json(await getStoreStatus()) } export async function PUT(req: NextRequest) { - if (!isAuthed()) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) const body = await req.json() const status = { closed: Boolean(body.closed),