booking status changed

This commit is contained in:
phyusin
2018-10-03 14:17:08 +06:30
parent 9dba93ea9c
commit 7bf01a863c
4 changed files with 66 additions and 11 deletions

View File

@@ -53,6 +53,19 @@ class Transactions::BookingsController < ApplicationController
end
end
def update_status
data = Booking.where("sale_id IS NULL AND booking_status='assign' AND booking_id = ?", params[:booking_id])
if !data.nil?
booking = Booking.find(params[:booking_id])
booking.booking_status = 'moved'
booking.save!
render :json => {:status => true, :message => "Update status successfully."}
else
render :json => {:status => false, :error_message => "Can't update status!"}
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_transactions_booking