Skip to content

Commit 76fe2ad

Browse files
committed
Removed duplicate from merge conflict
1 parent d7c6902 commit 76fe2ad

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

  • apps/fakeoverflow-api/FakeOverFlow/FakeoverFlow.Backend.Http.Api/Services

apps/fakeoverflow-api/FakeOverFlow/FakeoverFlow.Backend.Http.Api/Services/PostService.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -266,34 +266,4 @@ private async Task<List<Tag>> GetOrCreateTagsAsync(List<string> tags, Cancellati
266266
existingTags.AddRange(newTags);
267267
return existingTags;
268268
}
269-
270-
public async Task<(List<Tag> Tags, Dictionary<int, int> TagCounts)> GetTagsWithCountsAsync(int page = 0, int pageSize = 10,string? searchTerm = null, CancellationToken ct = default)
271-
{
272-
var postTagsEnumerable = dbContext.PostTags
273-
.Include(pt => pt.Tag)
274-
.AsQueryable()
275-
.AsNoTracking();
276-
277-
if (!string.IsNullOrWhiteSpace(searchTerm))
278-
{
279-
postTagsEnumerable =
280-
postTagsEnumerable.Where(pt => pt.Tag.VectorText.Matches(EF.Functions.ToTsQuery(searchTerm)));
281-
logger.LogInformation("Searching for {SearchTerm}", searchTerm);
282-
}
283-
284-
285-
286-
var result = postTagsEnumerable
287-
.GroupBy(pt => pt.Tag)
288-
.Select(g => new
289-
{
290-
Tag = g.Key,
291-
Count = g.Count()
292-
})
293-
.Skip(page * pageSize)
294-
.Take(pageSize)
295-
.ToList();
296-
297-
return (result.Select(x => x.Tag).ToList(), result.ToDictionary(x => x.Tag.Id, x => x.Count));
298-
}
299269
}

0 commit comments

Comments
 (0)