From 6e9b8fdd8b69ea2481b5f15f90417c7f26e42cf7 Mon Sep 17 00:00:00 2001 From: Colby Swandale <996377+colby-swandale@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:40:52 +1000 Subject: [PATCH] add endpoint to show form to archive gem --- app/helpers/rubygems_helper.rb | 8 ++++++++ config/routes.rb | 1 + 2 files changed, 9 insertions(+) diff --git a/app/helpers/rubygems_helper.rb b/app/helpers/rubygems_helper.rb index 7898a9e9475..f3720ab5342 100644 --- a/app/helpers/rubygems_helper.rb +++ b/app/helpers/rubygems_helper.rb @@ -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) diff --git a/config/routes.rb b/config/routes.rb index f532cea097f..8c5ae359dd2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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