Skip to content

Commit

Permalink
Add custom craft query filter
Browse files Browse the repository at this point in the history
  • Loading branch information
U-lis committed Oct 15, 2024
1 parent 2944199 commit e1c468a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion MarketService/Controllers/MarketController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public async Task<MarketProductResponse> GetItemProducts(int type, int? limit, i
}

private async Task<List<ItemProductModel>> Get(ItemSubType itemSubType, int queryLimit, int queryOffset,
string sort, StatType statType, int[] iconIds)
string sort, StatType statType, int[] iconIds, bool isCustom = false)
{
var ids = string.Join("_", iconIds.OrderBy(i => i));
var cacheKey = $"{itemSubType}_{queryLimit}_{queryOffset}_{sort}_{statType}_{ids}";
Expand All @@ -68,6 +68,11 @@ private async Task<List<ItemProductModel>> Get(ItemSubType itemSubType, int quer
query = query.Where(p => iconIds.Contains(p.IconId));
}

if (isCustom)
{
query = query.Where(p => p.ByCustomCraft);
}

query = query.AsSingleQuery();
query = sort switch
{
Expand Down

0 comments on commit e1c468a

Please sign in to comment.