예제 #1
0
        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();
            }
        }
예제 #2
0
        public async Task <IActionResult> AddOrUpdateCallId(AddOrUpdateCallIdRequest request)
        {
            var data = await userService.AddOrUpdateCallId(request);

            return(Ok(new ApiOkResponse(data)));
        }