update booking with cancel and assign

This commit is contained in:
Aung Myo
2017-06-02 10:52:46 +06:30
parent acbd8acf04
commit c9782bf84a
5 changed files with 127 additions and 113 deletions

View File

@@ -11,13 +11,17 @@ class Api::BookingsController < Api::ApiController
end
def update_booking
booking = Booking.find(params[:booking_id])
status = booking.update_attributes(booking_status: params[:type])
if status
render json: JSON.generate({:status => true ,:type => params[:type]})
else
render json: JSON.generate({:status => false, :error_message => "Record not found"})
booking = Booking.find_by(id: params[:booking])
booking.update_all(booking_status: 'Dave')
end
end
end
# private
# def Bookings_params