public ActionResult <Schedule> AddPlaceSchedule(int facilityID, int placeID, int diseaseID, int intervalMin = 300) { User user = UserRep.FindByEmail(User.Identity.Name); Facility facility = FacilityRep.Find(facilityID); Place place = PlaceRep.Find(placeID); Disease disease = DiseaseRep.Find(diseaseID); if (place.FacilityID != facilityID) { return(new ForbidResult()); } else if (FacilityRep.IsAdmin(user, facility)) { return(Ok(PlaceRep.AddSchedule(place, disease, intervalMin))); } else { return(new ForbidResult()); } }