mirror of
https://github.com/we-promise/sure.git
synced 2026-04-17 02:54:10 +00:00
Add ability to delete invite codes (#153)
* Add ability to delete invite codes Implemented destroy action in InviteCodesController and updated routes to support invite code deletion. Updated invite code partial to include a delete button and improved styling. Also refactored the generate tokens button in invite code settings to use DS::Button. * Show advanced settings only to admin users Updated the settings navigation to display the advanced section only for admin users. Also improved handling of hidden elements in the invite code CSS.
This commit is contained in:
@@ -11,6 +11,12 @@ class InviteCodesController < ApplicationController
|
||||
redirect_back_or_to invite_codes_path, notice: "Code generated"
|
||||
end
|
||||
|
||||
def destroy
|
||||
code = InviteCode.find(params[:id])
|
||||
code.destroy
|
||||
redirect_back_or_to invite_codes_path, notice: "Code deleted"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def ensure_self_hosted
|
||||
|
||||
Reference in New Issue
Block a user