public async Task <UserViewModel> AddOrUpdateCallId(AddOrUpdateCallIdRequest request) { var user = await userRepository.GetByIdAsync(ObjectId.Parse(request.UserId)); if (user != null) { user.CallId = request.CallId; await userRepository.UpdateAsync(user, user.Id); return(mapper.Map <UserViewModel>(user)); } else { throw new Exception(); } }
public async Task <IActionResult> AddOrUpdateCallId(AddOrUpdateCallIdRequest request) { var data = await userService.AddOrUpdateCallId(request); return(Ok(new ApiOkResponse(data))); }