update booking with cancel and assign
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user