Skip to content

Commit

Permalink
Added 404 JSON reponse to projects.show method
Browse files Browse the repository at this point in the history
  • Loading branch information
abujeda committed Jul 11, 2024
1 parent 02a1f2b commit 350250b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/dashboard/app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ def show
project_id = show_project_params[:id]
@project = Project.find(project_id)
if @project.nil?
redirect_to(projects_path, alert: I18n.t('dashboard.jobs_project_not_found', project_id: project_id))
respond_to do |format|
message = I18n.t('dashboard.jobs_project_not_found', project_id: project_id)
format.html { redirect_to(projects_path, alert: message) }
format.json { render json: { message: message }, status: :not_found }
end
else
@scripts = Launcher.all(@project.directory)
@valid_project = Launcher.clusters?
Expand Down

0 comments on commit 350250b

Please sign in to comment.