2019-07-30 21:29:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-25 16:15:39 +00:00
|
|
|
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
2018-03-25 17:30:42 +00:00
|
|
|
module Nonprofits
|
|
|
|
class MiscellaneousNpInfosController < ApplicationController
|
2018-08-08 21:31:42 +00:00
|
|
|
include Controllers::NonprofitHelper
|
2018-03-25 17:30:42 +00:00
|
|
|
|
|
|
|
helper_method :current_nonprofit_user?
|
2019-07-13 07:53:59 +00:00
|
|
|
before_action :authenticate_nonprofit_user!
|
2018-03-25 17:30:42 +00:00
|
|
|
|
|
|
|
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|
|
2019-07-30 21:29:24 +00:00
|
|
|
format.json do
|
|
|
|
render_json do
|
2018-03-25 17:30:42 +00:00
|
|
|
update = UpdateMiscellaneousNpInfo.update(params[:nonprofit_id], params[:miscellaneous_np_info])
|
2019-07-30 21:29:24 +00:00
|
|
|
# flash[:notice] = "Your Miscellaneous Settings have been saved"
|
2018-03-25 17:30:42 +00:00
|
|
|
update
|
2019-07-30 21:29:24 +00:00
|
|
|
end
|
|
|
|
end
|
2018-03-25 17:30:42 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|