public async Task <BaseResponse> UpdateLocation(UserLocationDto driverLocation) { long userId = _principalService.GetUserId(); ApplicationUser user = await _userManager.FindByIdAsync(userId.ToString()); if (user != null) { user.Latitude = driverLocation.Latitude; user.Longitude = driverLocation.Longitude; await _userManager.UpdateAsync(user); return(new BaseResponse { Code = RsponseCode.Success, Message = "" }); } return(new BaseResponse { Code = RsponseCode.NotFound, Message = "حصل خطأ " }); }
public async Task <IActionResult> UpdateLocation([FromBody] UserLocationDto model) { var result = await _userService.UpdateLocation(model); return(Ok(result)); }