From 48e80f0dbd88f9ff57811b50344c2c8bc97dd6c3 Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Tue, 17 Dec 2024 12:28:55 -0500 Subject: [PATCH] fix(search): single if --- packages/interface/src/utils/fetchProjects.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/interface/src/utils/fetchProjects.ts b/packages/interface/src/utils/fetchProjects.ts index 43761ac4..243a900b 100644 --- a/packages/interface/src/utils/fetchProjects.ts +++ b/packages/interface/src/utils/fetchProjects.ts @@ -116,11 +116,9 @@ export async function fetchApprovedProjectsWithMetadata( const recipients = await Promise.all( response.map(async (request) => { const metadata = (await fetchMetadata(request.metadataUrl)) as unknown as Application; - if (search !== "") { - const name = metadata.name.toLowerCase(); - if (!name.includes(search.trim().toLowerCase())) { - return null; - } + const name = metadata.name.toLowerCase(); + if (search !== "" && !name.includes(search.trim().toLowerCase())) { + return null; } return { id: request.id,