Closed gazayas closed 1 year ago
For more context, here is a comment from one of our developers: https://discord.com/channels/836637622432170028/1070662805549744169/1070707736465125476
You can see in the error logs that file
is returning a random string, like I mentioned in the first comment:
Unpermitted parameter: :file_removal. Context: { controller: Account::Employees::ImportActionsController, action: create, request: #<ActionDispatch::Request:0x0000ffff9806cbe0>, params: {"authenticity_token"=>"[FILTERED]", "employees_import_action"=>{"file_removal"=>"", "file"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--e796bc5eec13a0ebf5cd8e7b12b7a4cde8cbefa5", "copy_mapping_from_id"=>""}, "commit"=>"Configure Import Action", "controller"=>"account/employees/import_actions", "action"=>"create", "team_id"=>"bJYLew"} }
With the fix in this PR we can get to the next page, but when we click "Preview Import Action", we get another error:
NoMethodError in Account::Foos::ImportActions#show
undefined method `approve_account_foos_import_action_path' for #<ActionView::Base:0x0000000003c140>
<%= button_to t('.buttons.approve'), [:approve, :account, @import_action], method: :post, class: first_button_primary if can? :approve, @import_action %>
Also, I'm not sure what to do about the unpermitted parameter, but I'd be glad to learn more about import actions themselves to see what we can do to solve this issue.
I was looking into #25 and noticed the
csv
method wasn't working. The original line we had here gave me a random string instead of the CSV's contents, so theread
method was raising an error.With that being said I think I'll leave #25 for a bit. I'm still running into errors like what's in #20 (although the errors could just be the result of how I'm setting things up).
I think I have a better idea of how imports are supposed to work though, so I definitely want to come back to it soon.