Browse Source

Use CmsUserLookupServiceGetByIdAsync instead of FindByIdAsync.

pull/5082/head
Halil İbrahim Kalkan 6 years ago
parent
commit
793998ac42
  1. 8
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs

8
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs

@ -42,13 +42,7 @@ namespace Volo.CmsKit.Public.Comments
[Authorize]
public virtual async Task<CommentDto> CreateAsync(string entityType, string entityId, CreateCommentInput input)
{
var user = await CmsUserLookupService.FindByIdAsync(CurrentUser.GetId());
if (user == null)
{
//TODO: Localize
throw new BusinessException(message: "User Not found!");
}
var user = await CmsUserLookupService.GetByIdAsync(CurrentUser.GetId());
var comment = await CommentRepository.InsertAsync(
new Comment(

Loading…
Cancel
Save