smpallen99/coherence

Question - How would you use Invitable to let X user invite users under their team?

isAlmogK opened this issue · 2 comments

I wanted to know if it's possible to setup Invitable were one user can invite team members under a team within the app? And if so how would this be done?

my intuition will be,
1- copy, paste the create function from Coherence.InvitationController, change it and write some tests to be sure it won't break after a coherence version upgrade

@spec create(conn, params) :: conn
def create(conn, %{"invitation" => invitation_params} = params) do

or
2- I saw that coherence provides a Json responder, if you are already using it in an api way and the count of members in a team is small. there will be the option to send async post requests to:

resources "#{routes.invitations}", Coherence.InvitationController, only: [:create]

and handle every single response with javascript

@moalfa is correct. Generate controllers for ur project and modify them as needed.