Open tsov opened 11 years ago
update! I just edited the issue
About that
def create
# POST /groups/:id/members
#
# Creates a new member for this group
# IF this user is a pending member of this group
end
I think this creates sort of a feeling that you can create a member directly. where this is not true. You can only invite someone, and that someone, can accept the invitation.
I think if we go ahead and say that to accept the invitation, you go to PUT /groups/:id/invited and send accepted=true / accepted=false this will be better. Then a the user moved form invited to members or deleted from invited. I think it's bit more concise with what's actually going on. What do you think ?
We can make it so you can delete the invitation, with the delete, if it's been sent already but user hasn't got a change to accept it.
Ok sounds like a good idea too, but the idea was that in the end you are creating the resource GroupMember Otherwise we would create a GroupMember resource in the PendingMember resource. Do you know what I mean? I am not objecting your idea, but I am also not very sure which way to go.
But you are not really creating group member per say, as you do not have power to do so. A group member is an outcome of you creating invitation and invited person accepting it. That is my way of thinking about it. My intuition is that POST group/:id/members is not proper as you are not creating it. No one can go and actually make a group member. You must invite someone, and that person must accept invitation. There isn't a situation where you can actually just go ahead and create member. I think doing it that way is a bit confusing, where as just accepting membership, with PUT group/:id/invited?accepted=true is more clear. But that's just my idea.
straight to the point:
we need...
1. two nested resources inside the groups resource
2. two controllers