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) ) );