private SocialBase MapToSocial(SocialEditModel socialEditModel) { var social = _socialService.Get(socialEditModel.Id); social = socialEditModel.Map(social); social.MediaIds = social.MediaIds.Concat(_mediaHelper.CreateMedia(socialEditModel, MediaFolderTypeEnum.SocialsContent)); return(social); }
public async Task <IHttpActionResult> Update(SocialEditModel socialEdit) { //if (!_permissionsService.Check(new PermissionSettingIdentity(PermissionActionEnum.Edit, PermissionResourceTypeEnum.Social))) if (!await _socialService.CanEditAsync(socialEdit.Id)) { return(Ok((await _activityLinkService.GetLinksAsync(socialEdit.Id)).Details)); } var social = MapToSocial(socialEdit); await _socialService.SaveAsync(social); await OnSocialEditedAsync(social, socialEdit); var model = await GetSocialViewModelAsync(social.Id); ReloadFeed(); return(Ok(model.Links.Details)); }
private async Task OnSocialEditedAsync(SocialBase social, SocialEditModel model) { await _activityTagsHelper.ReplaceTagsAsync(social.Id, model.TagIdsData); await ResolveMentionsAsync(model.Description, social); }
private void OnBulletinEdited(SocialBase social, SocialEditModel model) { _activityTagsHelper.ReplaceTags(social.Id, model.TagIdsData); ResolveMentions(model.Description, social); }