Пример #1
0
        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);
        }
Пример #2
0
        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));
        }
Пример #3
0
        private async Task OnSocialEditedAsync(SocialBase social, SocialEditModel model)
        {
            await _activityTagsHelper.ReplaceTagsAsync(social.Id, model.TagIdsData);

            await ResolveMentionsAsync(model.Description, social);
        }
Пример #4
0
        private void OnBulletinEdited(SocialBase social, SocialEditModel model)
        {
            _activityTagsHelper.ReplaceTags(social.Id, model.TagIdsData);

            ResolveMentions(model.Description, social);
        }