Discourse gem group_add

It looks like the API to add and remove users from a group has changed too from the version in the Gem.

The gem makes a patch request to /admin/groups/group_id with

{
    "changes": {
        "add": [
            "sam"
        ]
    }
}

Discourse currently seems to expect a PUT to /admin/groups/group_id/members.json to add a user, and a DELETE to the same path to remove a user. However the DELETE call now seems to take the user_id as a param, not the username.

Again I am happy to fix. Shall we just change the gem to fit the current Discourse API? It means we only need to change the code in the gem. The drawback is that it is a little ugly to add users via username and remove via id in the interface.

1 Like