1 year ago

Many to many in RestFUL API

Posted 1 year ago by Cinek

I have 2 tables:

  • user(id,name)
  • group(id,name)
  • user_groups(id,user_id,group_id,status,role)

In the user_groups table there can be only one entry with given user_id and group_id. When user is invited to group there should be created user_groups entry with status = 0. When user accepts invitation status should change to 1. My question is how to design restful routes to this situation. How to add/edit entries in user_groups table?

Please sign in or create an account to participate in this conversation.