0

Update search.ts

This commit is contained in:
Nicolas 2024-04-23 17:06:48 -07:00
parent 53cc4c396f
commit 3abfd6b4c1

View File

@ -37,12 +37,13 @@ export async function searchHelper(
return { success: true, data: res, returnCode: 200 }; return { success: true, data: res, returnCode: 200 };
} }
res = res.filter((r) => !isUrlBlocked(r));
if (res.length === 0) { if (res.length === 0) {
return { success: true, error: "No search results found", returnCode: 200 }; return { success: true, error: "No search results found", returnCode: 200 };
} }
// filter out social media links // filter out social media links
res = res.filter((r) => !isUrlBlocked(r));
const a = new WebScraperDataProvider(); const a = new WebScraperDataProvider();
await a.setOptions({ await a.setOptions({