Browse Source

Merge pull request #11843 from abpframework/issue/11699

Blogging: Convert tags to lowercase
pull/12029/head
Berkan Sasmaz 5 years ago
committed by GitHub
parent
commit
a9ddc74939
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs

13
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs

@ -231,11 +231,16 @@ namespace Volo.Blogging.Posts
return url;
}
private async Task SaveTags(ICollection<string> newTags, Post post)
private async Task SaveTags(ICollection<string> tags, Post post)
{
await RemoveOldTags(newTags, post);
await AddNewTags(newTags, post);
tags = tags
.Select(t => t.ToLowerInvariant())
.Distinct()
.ToList();
await RemoveOldTags(tags, post);
await AddNewTags(tags, post);
}
private async Task RemoveOldTags(ICollection<string> newTags, Post post)

Loading…
Cancel
Save