Example #1
0
 public async Task <IActionResult> UpdateLocation([FromBody] SaveLocationModel saveLocationModel)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     return(Ok(await _locationService.UpdateLocation(saveLocationModel)));
 }
Example #2
0
        public async Task <IActionResult> CreateLocation([FromBody] SaveLocationModel saveLocationModel)
        {
            string userId = User.FindFirst(ClaimTypes.NameIdentifier).Value;

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            return(Ok(await _locationService.CreateLocation(saveLocationModel, userId)));
        }