Example #1
0
        public async Task <IActionResult> Create([FromBody] TravelPlanDto travelPlanDto)
        {
            try
            {
                var userId        = HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.NameIdentifier).Value;
                var newTravelPlan = await _travelPlanService.CreateAsync(travelPlanDto, new Guid(userId));

                return(Ok(newTravelPlan));
            }
            catch (Exception exc)
            {
                return(BadRequest());
            }
        }