Skip to content

Commit

Permalink
fix routing error
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Jul 15, 2024
1 parent 0ac71f5 commit f3e01b5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

module Decidim
module Admin
# A command with all the business logic to create a taxonomy.
# A command with all the business logic to update a taxonomy.
# This command is called from the controller.
class UpdateShareToken < Decidim::Commands::UpdateResource
fetch_form_attributes :token, :expires_at, :organization, :user, :token_for
fetch_form_attributes :token, :expires_at
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def edit
def update
@form = form(ShareTokenForm).from_params(params, component:)

UpdateShareToken.call(@form) do
UpdateShareToken.call(@form, share_token) do
on(:ok) do
flash[:notice] = I18n.t("share_tokens.update.success", scope: "decidim.admin")
redirect_to share_tokens_path(component)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</h1>
</div>
<div class="item__edit-form">
<%= decidim_form_for(@form, html: { class: "form-defaults form edit_component_share_token" }) do |f| %>
<%= decidim_form_for(@form, url: component_share_token_path(id: share_token), html: { class: "form-defaults form edit_component_share_token" }) do |f| %>
<div class="card">
<div class="card-section">
<%= render partial: "form", object: f %>
Expand Down
1 change: 1 addition & 0 deletions decidim-admin/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ en:
help: These tokens are used to publicly share this unpublished resource to any user. They will be hidden when the resource is published. Click on the token's share icon to visit the shareable URL.
title: Share tokens
update:
error: There was a problem updating this token.
invalid: There was a problem updating the token.
success: Token updated successfully.
shared:
Expand Down

0 comments on commit f3e01b5

Please sign in to comment.