mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-24 20:28:06 +02:00
12 lines
326 B
Ruby
12 lines
326 B
Ruby
class InvitationsController < ApplicationController
|
|||
def accept
|
|||
invitation = Invitation.find_by(token: params[:token])
|
|||
if invitation.recipient_email == current_user.email
|
|||
Membership.create!(
|
|||
workspace_id: invitation.workspace_id,
|
|||
role: params[:role] || invitation.role
|
|||
)
|
|||
end
|
|||
end
|
|||
end
|