mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-22 22:57:35 +08:00
feat: search api remove cache header when result is empty
This commit is contained in:
@@ -57,6 +57,11 @@ export async function GET(request: Request) {
|
|||||||
}
|
}
|
||||||
const cacheTime = await getCacheTime();
|
const cacheTime = await getCacheTime();
|
||||||
|
|
||||||
|
if (flattenedResults.length === 0) {
|
||||||
|
// no cache if empty
|
||||||
|
return NextResponse.json({ results: [] }, { status: 200 });
|
||||||
|
}
|
||||||
|
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ results: flattenedResults },
|
{ results: flattenedResults },
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user