public async Task <ApiResponse> UpdateIsCoach(StringVm stringUpdateVm) { var user = _unitOfWork.userRepository.FindByCondition(x => x.Id == stringUpdateVm.UserId).FirstOrDefault(); if (user == null) { throw new MyNotFoundException(ApiResponseDescription.USER_NOT_FOUND); } user.IsCoach = Convert.ToBoolean(stringUpdateVm.Content); _unitOfWork.userRepository.Update(user); await _unitOfWork.CompleteAsync(); return(new ApiResponse(true)); }
public async Task <ApiResponse> UpdateYoutubeURL(StringVm updateURLVm) { var user = _unitOfWork.userRepository.FindByCondition(x => x.Id == updateURLVm.UserId).FirstOrDefault(); if (user == null) { throw new MyNotFoundException(ApiResponseDescription.USER_NOT_FOUND); } user.Youtube = updateURLVm.Content; _unitOfWork.userRepository.Update(user); await _unitOfWork.CompleteAsync(); return(new ApiResponse(true)); }
public async Task <IActionResult> UpdateIsCoach([FromBody] StringVm stringVm) => Ok(await _userInfoService.UpdateIsCoach(stringVm));
public async Task <IActionResult> UpdateDiscipline([FromBody] StringVm stringVm) => Ok(await _userInfoService.UpdateDiscipline(stringVm));
public async Task <IActionResult> UpdateDescription([FromBody] StringVm stringVm) => Ok(await _userInfoService.UpdateDescription(stringVm));
public async Task <IActionResult> UpdateYoutubeUrl([FromBody] StringVm stringVm) => Ok(await _userInfoService.UpdateYoutubeURL(stringVm));
public async Task <IActionResult> UpdateTwitterURL([FromBody] StringVm stringVm) => Ok(await _userInfoService.UpdateTwitterURL(stringVm));