Skip to content

Commit

Permalink
add endpoint to show form to archive gem
Browse files Browse the repository at this point in the history
  • Loading branch information
colby-swandale committed Aug 19, 2024
1 parent 65e9fd0 commit 6e9b8fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/helpers/rubygems_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ def rubygem_trusted_publishers_link(rubygem)
link_to t("rubygems.aside.links.trusted_publishers"), rubygem_trusted_publishers_path(rubygem.slug), class: "gem__link t-list__item"
end

def rubygems_archive_link(rubygem)
link_to t("rubges.aside.links.archive"), rubygems_archive_path(rubygem.slug), class: "gem__link t-list__item", method: "post"
end

def rubygems_unarchive_link(rubygem)
link_to t("rubges.aside.links.unarchive"), rubygems_archive_path(rubygem.slug), class: "gem__link t-list__item", method: "delete"
end

def oidc_api_key_role_links(rubygem)
roles = current_user.oidc_api_key_roles.for_rubygem(rubygem)

Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
resources :adoptions, only: %i[index]
resources :trusted_publishers, controller: 'oidc/rubygem_trusted_publishers', only: %i[index create destroy new]

get 'archive', to: 'archive#show'
post 'archive', to: 'archive#create'
delete 'archive', to: 'archive#destroy'
end
Expand Down

0 comments on commit 6e9b8fd

Please sign in to comment.