Example #1
0
        public async Task <IActionResult> CreateSection([FromRoute] int cvId, [FromBody] NewSectionParam section)
        {
            if (cvId != section.CVId)
            {
                return(Forbid());
            }
            try
            {
                CVSectionDataset result = await _cvService.CreateSection(section);

                if (result != null)
                {
                    return(Created("", result));
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("confict"))
                {
                    return(Conflict());
                }
            }
            return(BadRequest());
        }