def get_appointment(session, currentUser, appointment_id): controller = AppointmentController(session) try: res = flask.jsonify(controller.get_appointment(appointment_id)) except NoResultFound: res = flask.jsonify(status='error', errors=['could not find appointment']) res.status_code = 404 return res
def post_appointments(session, currentUser): controller = AppointmentController(session) data = flask.request.get_json() result = controller.post_appointment(data) return flask.jsonify(result)
def get_appointments(session, currentUser): controller = AppointmentController(session) appointments = controller.get_appointments() return flask.jsonify({'appointments':appointments})
def get_appointments(session, currentUser): controller = AppointmentController(session) appointments = controller.get_appointments() return flask.jsonify({'appointments': appointments})