about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/invites_controller.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/admin/invites_controller.rb b/app/controllers/admin/invites_controller.rb
index f4207e3e2..faccaa7c8 100644
--- a/app/controllers/admin/invites_controller.rb
+++ b/app/controllers/admin/invites_controller.rb
@@ -5,7 +5,7 @@ module Admin
     def index
       authorize :invite, :index?
 
-      @invites = Invite.includes(user: :account).page(params[:page])
+      @invites = filtered_invites.includes(user: :account).page(params[:page])
       @invite  = Invite.new
     end
 
@@ -29,5 +29,19 @@ module Admin
       @invite.expire!
       redirect_to admin_invites_path
     end
+
+    private
+
+    def resource_params
+      params.require(:invite).permit(:max_uses, :expires_in)
+    end
+
+    def filtered_invites
+      InviteFilter.new(filter_params).results
+    end
+
+    def filter_params
+      params.permit(:available, :expired)
+    end
   end
 end