Commit 4fbe044b authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent ee33b3e6
...@@ -35,14 +35,10 @@ class Projects::ArtifactsController < Projects::ApplicationController ...@@ -35,14 +35,10 @@ class Projects::ArtifactsController < Projects::ApplicationController
end end
def latest_succeeded def latest_succeeded
path = params[:path] target_url = artifacts_action_url(params[:path], project, build)
if %w[download browse file].include?(path) if target_url
redirect_to send( redirect_to(target_url)
"#{path}_namespace_project_build_artifacts_url",
project.namespace,
project,
build)
else else
render_404 render_404
end end
......
...@@ -149,4 +149,19 @@ module GitlabRoutingHelper ...@@ -149,4 +149,19 @@ module GitlabRoutingHelper
def resend_invite_group_member_path(group_member, *args) def resend_invite_group_member_path(group_member, *args)
resend_invite_group_group_member_path(group_member.source, group_member) resend_invite_group_group_member_path(group_member.source, group_member)
end end
# Artifacts
def artifacts_action_url(path, project, build)
args = [project.namespace, project, build]
case path
when 'download'
download_namespace_project_build_artifacts_url(*args)
when 'browse'
browse_namespace_project_build_artifacts_url(*args)
when 'file'
file_namespace_project_build_artifacts_url(*args)
end
end
end end
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