public IActionResult UpdateClubStatus([FromBody] ClubStatusQO newClubStatus) { var exist = _adminService.UpdateClubStatus(newClubStatus); if (exist) { return(Ok()); } else { return(NotFound()); } }
public bool UpdateClubStatus(ClubStatusQO newClubStatus) { var Club = _context.Clubs.Find(newClubStatus.ClubId); if (Club == null) { return(false); } if (Club.Status != 2) { return(false); } _context.Clubs.Attach(Club); Club.Status = newClubStatus.Status; _context.SaveChanges(); return(true); }