Пример #1
0
        public async Task <IActionResult> CreateCV([FromBody] NewCVParam cv)
        {
            int userId = int.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier));

            if (await _cvService.GetCVByName(cv.Title, userId) != null)
            {
                return(BadRequest(new { message = "CV title is existed" }));
            }
            CVDataset result = await _cvService.CreateCV(userId, cv.Title, cv.MajorId);

            if (result != null)
            {
                return(Created("", result));
            }
            return(BadRequest());
        }