Sha256: 6107360549fe3ef3212a4d1df92230e141672c430ddb49acfa68be7004830be5
Contents?: true
Size: 828 Bytes
Versions: 19
Compression:
Stored size: 828 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin class UpdateExternalDomainWhitelist < Decidim::Command attr_reader :form, :organization def initialize(form, organization, user) @form = form @organization = organization @user = user end def call return broadcast(:invalid) if form.invalid? Decidim.traceability.perform_action!("update_external_domain", @organization, @user) do save_domains! end broadcast(:ok) end private def save_domains! organization.external_domain_whitelist = form.external_domains.filter_map do |external_domain_form| external_domain_form.value unless external_domain_form.deleted end.flatten organization.save! end end end end
Version data entries
19 entries across 19 versions & 1 rubygems