feat: search api remove cache header when result is empty

This commit is contained in:
shinya
2025-08-16 22:34:12 +08:00
parent b489d01df5
commit 38522046de

View File

@@ -57,6 +57,11 @@ export async function GET(request: Request) {
}
const cacheTime = await getCacheTime();
if (flattenedResults.length === 0) {
// no cache if empty
return NextResponse.json({ results: [] }, { status: 200 });
}
return NextResponse.json(
{ results: flattenedResults },
{