public async Task <TeacherToggleDto> ToggleTeacherStatus(TeacherToggleDto teacherApproval) { var teacherStatus = _dbContext.Users.FirstOrDefault(p => p.Id == teacherApproval.Id); //if(teacherApproval.Status == Utility.BaseEnums.UserStatus.Rejected) //{ // teacherStatus.Status = teacherApproval.Status; // await _dbContext.SaveChangesAsync(); //} teacherStatus.Status = teacherApproval.Status; await _dbContext.SaveChangesAsync(); return(teacherApproval); }
public async Task <IActionResult> ToggleTeacherStatus(TeacherToggleDto teacherApproval) { var users = await _authRepository.ToggleTeacherStatus(teacherApproval); return(Ok(users)); }