diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml index b6ce055737..453ef5619e 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml @@ -22,8 +22,7 @@ @await Component.InvokeAsync(typeof(TagViewComponent), new { entityType = "quote", - entityId = "1", - tags = new List { "a", "b" } + entityId = "1" }) @@ -89,8 +88,7 @@ @await Component.InvokeAsync(typeof(TagViewComponent), new { entityType = "IndexPage", - entityId = Guid.Empty.ToString(), - tags = new List { "a", "b" } + entityId = Guid.Empty.ToString() }) diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Tags/GetRelatedTagsInput.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Tags/GetRelatedTagsInput.cs index 0019bbd661..ca9cd31b16 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Tags/GetRelatedTagsInput.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Tags/GetRelatedTagsInput.cs @@ -10,7 +10,5 @@ namespace Volo.CmsKit.Tags [Required] public string EntityId { get; set; } - - public List Tags { get; set; } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Tags/TagAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Tags/TagAppService.cs index c9ddef9629..4e096d9bf6 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Tags/TagAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Tags/TagAppService.cs @@ -13,7 +13,8 @@ namespace Volo.CmsKit.Tags public TagAppService( ITagManager tagManager, - ITagRepository tagRepository, IEntityTagRepository entityTagRepository) + ITagRepository tagRepository, + IEntityTagRepository entityTagRepository) { TagManager = tagManager; TagRepository = tagRepository; @@ -27,31 +28,6 @@ namespace Volo.CmsKit.Tags input.EntityId, CurrentTenant.Id); - if (input.Tags?.Count > 0) - { - var nonExisting = input.Tags - .Where(x => - !entities.Any(a => - a.Name.Equals(x.Trim(), - StringComparison.InvariantCultureIgnoreCase))); - - foreach (var tag in nonExisting) - { - var insertedTag = await TagManager.GetOrAddAsync( - input.EntityType, - tag, - tenantId: CurrentTenant?.Id); - - await EntityTagRepository.InsertAsync( - new EntityTag( - insertedTag.Id, - input.EntityId, - CurrentTenant?.Id)); - - entities.Add(insertedTag); - } - } - return ObjectMapper.Map, List>(entities); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Shared/Components/Tags/TagViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Shared/Components/Tags/TagViewComponent.cs index 83ad0e7e3a..9e787c4d4c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Shared/Components/Tags/TagViewComponent.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Shared/Components/Tags/TagViewComponent.cs @@ -21,14 +21,12 @@ namespace Volo.CmsKit.Web.Pages.CmsKit.Shared.Components.Tags public virtual async Task InvokeAsync( string entityType, - string entityId, - IEnumerable tags = null) + string entityId) { var tagDtos = await TagAppService.GetAllRelatedTagsAsync(new GetRelatedTagsInput { EntityId = entityId, - EntityType = entityType, - Tags = tags?.ToList() + EntityType = entityType }); var viewModel = new TagViewModel