feat(imports): add strong params

This commit is contained in:
Luis Castro 2019-08-06 16:07:04 +02:00 committed by Eric Schultz
parent 70b1095083
commit 41d578815a
2 changed files with 15 additions and 11 deletions

View file

@ -10,13 +10,19 @@ module Nonprofits
def create
render_json do
InsertImport.delay.from_csv_safe(
nonprofit_id: params[:nonprofit_id],
nonprofit_id: import_params[:nonprofit_id],
user_id: current_user.id,
user_email: current_user.email,
file_uri: params[:file_uri],
header_matches: params[:header_matches]
file_uri: import_params[:file_uri],
header_matches: import_params[:header_matches]
)
end
end
private
def import_params
params.permit(:nonprofit_id, :file_uri, :header_matches)
end
end
end

View file

@ -2,8 +2,6 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Import < ApplicationRecord
# TODO
# attr_accessible \
# :user_id, :user,
# :email, # email of the user who ma
# :nonprofit_id, :nonprofit,