예제 #1
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));
        }