From 23df52b54d098a699fc06db2c6f3fda3c5948182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Cu=C3=A9nod?= <4253884+jcuenod@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:24:04 -0500 Subject: [PATCH] Update termSearch.ts Filter out nulls rather than returning incorrect type :/ --- src/routes/termSearch.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/termSearch.ts b/src/routes/termSearch.ts index cb6c5be..96c1d2a 100644 --- a/src/routes/termSearch.ts +++ b/src/routes/termSearch.ts @@ -21,8 +21,8 @@ const mapMatchingTextSearchResults: MapToTermSearchResponseFunction = ( const row = matchingText.find((row) => row.parallelId === parallelId && row.moduleId === moduleId ); - return row ? mapTextResult(row) : []; - }) + return row ? mapTextResult(row) : null; + }).filter(parallelText => !!parallelText) ) );