Esempio n. 1
0
        public IActionResult PostFIndClosest(ClosestAddressInput addressInput)
        {
            try
            {
                var coordinates = _geocodingApi.GetCoordinates(addressInput.TargetLocation);

                if (coordinates is null)
                {
                    return(NotFound("could not find given address"));
                }

                var mission = _missionService.FIndNearestMission(coordinates);
                return(Ok(mission));
            }
            catch (Exception e)
            {
                // will log e.message
                return(StatusCode(500));
            }
        }