public async Task <ActionResult <IEnumerable <Appointment> > > EditAppointmentAsync(int appointmentId, [FromBody] Appointment appointment) { Appointment app = appointmentService.GetAppointmentById(appointmentId); if (app is null) { return(NotFound()); } if (!await RoleHelper.HasAccessToPatientSpecificDataAsync(User, userService, app.PatientId)) { return(Forbid()); } Appointment response = appointmentService.EditAppointmentById(appointmentId, appointment); if (response == null) { return(BadRequest()); } return(Ok(response)); }