public async Task <IActionResult> AuthorizeSchool(int schoolId, [FromQuery] bool accepted = true) { var school = await database.AdminRepository.Get <School>(schoolId); if (school.Accepted) { return(BadRequest("Szkółka już została zaakceptowana")); } bool result = false; if (accepted) { result = await adminService.AcceptSchool(school); } else { result = await adminService.DenySchool(school); } if (result) { return(NoContent()); } return(BadRequest("Autoryzacja szkółki nie powiodła się")); }