Commit 81027e5e by Ivan Lan

Add import_headers api

parent 9a8b6530
...@@ -46,6 +46,10 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -46,6 +46,10 @@ class SimpleController::BaseController < ::InheritedResources::Base
} }
end end
def import_headers
render json: { headers: importable_class.import_instance.import_headers }
end
def import def import
xlsx_file = params[:file] || importable_class.import_excel_klass.new(params[:uid]) xlsx_file = params[:file] || importable_class.import_excel_klass.new(params[:uid])
response = importable_class.import_xlsx(xlsx_file, collection, **params.to_unsafe_h.symbolize_keys) response = importable_class.import_xlsx(xlsx_file, collection, **params.to_unsafe_h.symbolize_keys)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment