Skip to content

Commit

Permalink
Update query filter by iconId
Browse files Browse the repository at this point in the history
  • Loading branch information
U-lis committed Oct 15, 2024
1 parent f4b7bca commit 2944199
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MarketService/Controllers/MarketController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ 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[] itemIds)
string sort, StatType statType, int[] iconIds)
{
var ids = string.Join("_", itemIds.OrderBy(i => i));
var ids = string.Join("_", iconIds.OrderBy(i => i));
var cacheKey = $"{itemSubType}_{queryLimit}_{queryOffset}_{sort}_{statType}_{ids}";
if (!_memoryCache.TryGetValue(cacheKey, out List<ItemProductModel>? queryResult))
{
Expand All @@ -63,9 +63,9 @@ private async Task<List<ItemProductModel>> Get(ItemSubType itemSubType, int quer
query = query.Where(p => p.Stats.Any(s => s.Type == statType));
}

if (itemIds.Any())
if (iconIds.Any())
{
query = query.Where(p => itemIds.Contains(p.ItemId));
query = query.Where(p => iconIds.Contains(p.IconId));
}

query = query.AsSingleQuery();
Expand Down

0 comments on commit 2944199

Please sign in to comment.