Skip to content

Commit f3411c3

Browse files
mircea-cosbuctbarbugli
authored andcommitted
Fix PUT call in update_channel_type (#7)
1 parent d63e323 commit f3411c3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

stream_chat/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def list_channel_types(self):
207207
return self.get("channeltypes")
208208

209209
def update_channel_type(self, channel_type, **settings):
210-
return self.put("channeltypes/{}".format(channel_type), **settings)
210+
return self.put("channeltypes/{}".format(channel_type), data=settings)
211211

212212
def delete_channel_type(self, channel_type):
213213
"""

stream_chat/tests/test_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ def test_list_channel_types(self, client):
2727
response = client.list_channel_types()
2828
assert "channel_types" in response
2929

30+
def test_update_channel_type(self, client):
31+
response = client.update_channel_type("team", commands=["ban", "unban"])
32+
assert "commands" in response
33+
assert response["commands"] == ["ban", "unban"]
34+
3035
def test_create_token(self, client):
3136
token = client.create_token("tommaso")
3237
payload = jwt.decode(token, client.api_secret, algorithm="HS256")

0 commit comments

Comments
 (0)