before sync

This commit is contained in:
Zoey
2019-06-21 10:04:35 +06:30
parent 60a3655dc3
commit f21d144111
17 changed files with 229 additions and 161 deletions

View File

@@ -13,5 +13,8 @@ class Api::SyncController < Api::ApiController
ShiftSale.sync_shift_sale_records(params[:shift_sales])
Booking.sync_booking_records(params[:bookings])
AssignedOrderItem.sync_assigned_order_item_records(params[:assigned_order_items])
SeedGenerator.sync_seed_generator_records(params[:seed_generators])
# render :json => { :status => true, :message => "Hello!" }
end
end

View File

@@ -77,6 +77,7 @@ authorize_resource :class => false
# url = "http://192.168.1.176:3000/en/api/sync_data"
url = Lookup.sync_url
token = Lookup.get_sync_token
@message = ''
# token = Lookup.token
unless url.nil? and token.nil?
@@ -118,11 +119,12 @@ authorize_resource :class => false
puts url
puts response
end
@message = @result.parsed_response['message']
end
respond_to do |format|
format.html { redirect_to '/en/reports/receipt_no/', notice: 'Sync Record Completed.'}
end
respond_to do |format|
format.html { redirect_to '/en/reports/receipt_no/', notice: @message}
end
end
end