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