app/controllers/medivo/labs_controller.rb in medivo-0.2.21 vs app/controllers/medivo/labs_controller.rb in medivo-0.2.24
- old
+ new
@@ -13,13 +13,21 @@
rescue => e
appointment_error_handler(e)
end
def make_appointment
- data = Medivo::Appointment.make(params[:lab_code], params[:time], params[:user])
+ time = Time.parse(params[:time])
+ data = Medivo::Appointment.make(params[:lab_code], time, params[:user])
render :json=> data
rescue Exception => e
appointment_error_handler(e)
+ end
+
+ def cancel_appointment
+ data = Medivo::Appointment.cancel(params[:confirmation], params[:first_name], params[:last_name])
+ render :json=> data
+ rescue Exception => e
+ render :status=> 500, json: {message: e.message}
end
def appointment_error_handler(e)
case e
when RestClient::RequestTimeout, RestClient::InternalServerError