lib/discourse_api/api/groups.rb in discourse_api-0.2.5 vs lib/discourse_api/api/groups.rb in discourse_api-0.2.7

- old
+ new

@@ -1,14 +1,22 @@ module DiscourseApi module API module Groups - def create_group(name:, visible: false) + def create_group(name:, visible: true) post("/admin/groups", group: {name: name, visible: visible.to_s}) end def groups - response = get("/admin/groups") + response = get("/admin/groups.json") response.body + end + + def group_add(group_id, *usernames) + patch("/admin/groups/#{group_id}", changes: {add: usernames}) + end + + def group_remove(group_id, *usernames) + patch("/admin/groups/#{group_id}", changes: {delete: usernames}) end end end end