public virtual ActionResult Hide(Guid id)
        {
            var command = new HideGroupCommand(id);

            _commandPublisher.Publish(command);

            return(Json(_groupLinkProvider.GetGroupsOverviewLink()));
        }
Example #2
0
        public virtual ActionResult Hide(Guid id)
        {
            var canHide = _groupService.CanHide(id);

            if (canHide)
            {
                var command = new HideGroupCommand(id);
                _commandPublisher.Publish(command);
            }

            return(Json(canHide ? _groupLinkProvider.GetGroupsOverviewLink() :
                        _groupLinkProvider.GetGroupLink(id)));
        }
Example #3
0
        public virtual async Task <IHttpActionResult> Hide(Guid id)
        {
            var group = await _groupService.GetAsync(id);

            if (group == null || group.IsHidden)
            {
                return(NotFound());
            }

            var canHide = await _groupService.CanHideAsync(id);

            if (!canHide)
            {
                return(Ok(_groupLinkProvider.GetGroupRoomLink(id)));
            }

            var command = new HideGroupCommand(id);

            _commandPublisher.Publish(command);

            return(Ok(_groupLinkProvider.GetGroupsOverviewLink()));
        }