Skip to content

Commit

Permalink
add more methods to sharetokenform
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Jul 15, 2024
1 parent de4278a commit ea6051d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Admin
# A command with all the business logic to create a taxonomy.
# This command is called from the controller.
class CreateShareToken < Decidim::Commands::CreateResource
fetch_form_attributes :token, :expires_at, :organization
fetch_form_attributes :token, :expires_at, :organization, :user, :token_for

protected

Expand Down
12 changes: 12 additions & 0 deletions decidim-admin/app/forms/decidim/admin/share_token_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ def expires_at

super
end

def token_for
context[:current_component]
end

def organization
context[:current_organization]
end

def user
context[:current_user]
end
end
end
end

0 comments on commit ea6051d

Please sign in to comment.