1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 07:39:39 +02:00

Add/remove members and invitations (#1744)

* Add/remove members and invitations

* Lint
This commit is contained in:
Josh Pigford 2025-01-30 13:13:37 -06:00 committed by GitHub
parent 282c05345d
commit 0696e1f2f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 188 additions and 29 deletions

View file

@ -34,6 +34,24 @@ class InvitationsController < ApplicationController
end
end
def destroy
unless Current.user.admin?
flash[:alert] = t("invitations.destroy.not_authorized")
redirect_to settings_profile_path
return
end
@invitation = Current.family.invitations.find(params[:id])
if @invitation.destroy
flash[:notice] = t("invitations.destroy.success")
else
flash[:alert] = t("invitations.destroy.failure")
end
redirect_to settings_profile_path
end
private
def invitation_params