Skip to content

Commit 4a83c85

Browse files
committed
TD-2180-Search text with spaces fixed.
1 parent 0f5f87c commit 4a83c85

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

DigitalLearningSolutions.Data/DataServices/CourseDataService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ LEFT JOIN CoursePrompts AS cp3 WITH (NOLOCK)
727727
AND (cu.CentreID = @centreId OR (cu.AllCentres = 1 AND ca.Active = @allCentreCourses))
728728
AND ca.CentreID = @centreId
729729
AND ap.DefaultContentTypeID <> 4
730-
AND ( ap.ApplicationName + ' ' + ' ' + cu.CustomisationName LIKE N'%' + @searchString + N'%')
730+
AND ( ap.ApplicationName + IIF(cu.CustomisationName IS NULL, '', ' - ' + cu.CustomisationName) LIKE N'%' + @searchString + N'%')
731731
AND ((@isActive = 'Any') OR (@isActive = 'true' AND (cu.Active = 1 AND ap.ArchivedDate IS NULL)) OR (@isActive = 'false' AND ((cu.Active = 0 OR ap.ArchivedDate IS NOT NULL))))
732732
AND ((@categoryName = 'Any') OR (cc.CategoryName = @categoryName))
733733
AND ((@courseTopic = 'Any') OR (ct.CourseTopic = @courseTopic))

DigitalLearningSolutions.Web/Controllers/TrackingSystem/Delegates/DelegateCoursesController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public IActionResult Index(
6060
int? itemsPerPage = 10
6161
)
6262
{
63+
searchString= searchString==null ? string.Empty : searchString.Trim();
6364
sortBy ??= DefaultSortByOptions.Name.PropertyName;
6465
sortDirection ??= GenericSortingHelper.Ascending;
6566

0 commit comments

Comments
 (0)