feat(products): add public access to findAll and findAllTags endpoints

feat(ai): enhance AI admin client with status messages for API key configuration
refactor(api): remove authorization check from products route
This commit is contained in:
Nils-Johan Gynther
2026-04-19 11:42:10 +02:00
parent 045f160655
commit 39b91d8c87
3 changed files with 17 additions and 10 deletions
+2 -7
View File
@@ -1,18 +1,13 @@
import { NextRequest, NextResponse } from 'next/server';
import { getAuthHeaders } from '../../../lib/auth-headers';
const API_BASE = process.env.NEXT_PUBLIC_API_URL_INTERNAL || 'http://recipe-api:8080';
export async function GET(req: NextRequest) {
const authHeaders = await getAuthHeaders();
if (!authHeaders.Authorization) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}
export const dynamic = 'force-dynamic';
export async function GET(req: NextRequest) {
const url = new URL(req.url);
const query = url.searchParams.toString();
const res = await fetch(`${API_BASE}/api/products${query ? `?${query}` : ''}`, {
headers: authHeaders,
cache: 'no-store',
});