Esempio n. 1
0
        public async Task <IActionResult> Create([FromBody] CreateGroupRequest request)
        {
            try
            {
                var userKey = _contextAccessor.UserKeyFromContext();

                var newGroup = await _hiarcDatabase.CreateGroup(request, userKey);

                var uri = $"{_hiarcSettings.BaseUri}/groups/{newGroup.Key}";
                return(Created(uri, newGroup));
            }
            catch (Exception ex)
            {
                return(BuildErrorResponse(ex, _logger));
            }
        }