houdini/app/controllers/nonprofits/miscellaneous_np_infos_controller.rb

34 lines
970 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2020-06-12 20:03:43 +00:00
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
module Nonprofits
class MiscellaneousNpInfosController < ApplicationController
include Controllers::Nonprofit::Current
include Controllers::Nonprofit::Authorization
helper_method :current_nonprofit_user?
before_action :authenticate_nonprofit_user!
def show
respond_to do |format|
format.json do
render_json { FetchMiscellaneousNpInfo.fetch(params[:nonprofit_id]) }
end
end
end
def update
respond_to do |format|
format.json do
render_json do
update = UpdateMiscellaneousNpInfo.update(params[:nonprofit_id], params[:miscellaneous_np_info])
# flash[:notice] = "Your Miscellaneous Settings have been saved"
update
end
end
end
end
end
end