Sha256: d41a529858b4596eb65e7ff736e4a2905fab6c9ea7cb0d70cd53919fda192b5d
Contents?: true
Size: 1.21 KB
Versions: 19
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true module Decidim module Admin class OrganizationExternalDomainWhitelistController < Decidim::Admin::ApplicationController layout "decidim/admin/settings" helper_method :blank_external_domain def edit enforce_permission_to :update, :organization, organization: current_organization @form = form(OrganizationExternalDomainWhitelistForm).from_model(current_organization) end def update enforce_permission_to :update, :organization, organization: current_organization @form = form(OrganizationExternalDomainWhitelistForm).from_params(params) UpdateExternalDomainWhitelist.call(@form, current_organization) do on(:ok) do flash[:notice] = t("domain_whitelist.update.success", scope: "decidim.admin") redirect_to edit_organization_external_domain_whitelist_path end on(:invalid) do flash[:notice] = t("domain_whitelist.update.error", scope: "decidim.admin") render action: "edit" end end end private def blank_external_domain @blank_external_domain ||= Admin::ExternalDomainForm.new end end end end
Version data entries
19 entries across 19 versions & 1 rubygems