Update search provider sort logic, and added testing for circle search provider.

This commit is contained in:
2025-08-30 16:21:35 -04:00
parent f221deea36
commit 516060963e
11 changed files with 435 additions and 143 deletions

View File

@@ -1,4 +1,5 @@
using JSMR.Application.Creators.Queries.Search.Contracts;
using JSMR.Application.Common.Search;
using JSMR.Application.Creators.Queries.Search.Contracts;
using JSMR.Application.Creators.Queries.Search.Ports;
using JSMR.Infrastructure.Common.Queries;
using System.Linq.Expressions;
@@ -54,6 +55,11 @@ public class CreatorSearchProvider(AppDbContext context) : SearchProvider<Creato
return query.OrderBy(x => x.Name);
}
protected override IEnumerable<(Expression<Func<CreatorSearchItem, object>> Selector, SortDirection Dir)> GetDefaultSortChain()
{
yield return (x => x.Name ?? string.Empty, SortDirection.Ascending);
}
protected override IOrderedQueryable<CreatorSearchItem> GetSelectQuery(IOrderedQueryable<CreatorSearchItem> query)
{
return query;