Skip to content

Commit

Permalink
Added notice if no isolate file is selected.
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahW91 committed Mar 12, 2022
1 parent bf8740e commit e862bc8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/controllers/isolates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,14 @@ def filter
def import
file = params[:file]

IsolateImporter.perform_async(file, current_user.default_project_id)
redirect_to isolates_path,
notice: "Isolate and specimen data will be imported in the background."
if file
IsolateImporter.perform_async(params[:file], current_user.default_project_id)
redirect_to isolates_path,
notice: "Isolate and specimen data will be imported in the background."
else
redirect_to isolates_path,
alert: "Please provide an appropriate file containing isolate and specimen data."
end
end

def show; end
Expand Down

0 comments on commit e862bc8

Please sign in to comment.