From 25d6c635a346e6c665d72f0473873c5bd610947c Mon Sep 17 00:00:00 2001 From: NotNite Date: Tue, 21 Sep 2021 20:06:49 -0400 Subject: [PATCH] send 201 on channel create to make client happy --- litecord/blueprints/guild/channels.py | 2 +- tests/test_channels.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/litecord/blueprints/guild/channels.py b/litecord/blueprints/guild/channels.py index 3f5d809..56a1d21 100644 --- a/litecord/blueprints/guild/channels.py +++ b/litecord/blueprints/guild/channels.py @@ -62,7 +62,7 @@ async def create_channel(guild_id): chan = await app.storage.get_channel(new_channel_id) await app.dispatcher.guild.dispatch(guild_id, ("CHANNEL_CREATE", chan)) - return jsonify(chan) + return jsonify(chan), 201 async def _chan_update_dispatch(guild_id: int, channel_id: int): diff --git a/tests/test_channels.py b/tests/test_channels.py index 47d33b4..0a7203b 100644 --- a/tests/test_channels.py +++ b/tests/test_channels.py @@ -33,7 +33,7 @@ async def test_channel_create(test_cli_user): "name": "hello-world", }, ) - assert resp.status_code == 200 + assert resp.status_code == 201 rjson = await resp.json channel_id: str = rjson["id"] assert rjson["name"] == "hello-world"