gitlink-forgeplus/app/controllers/admins/organizations_controller.rb

28 lines
567 B
Ruby

class Admins::OrganizationsController < Admins::BaseController
before_action :finder_org, except: [:index]
def index
params[:sort_by] = params[:sort_by].presence || 'created_on'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
orgs = Admins::OrganizationQuery.call(params)
@orgs = paginate orgs
end
def show
end
def destroy
@org.destroy!
Admins::DeleteOrganizationService.call(@org.login)
render_delete_success
end
private
def finder_org
@org = Organization.find(params[:id])
end
end