Skip to content

Commit 5b97205

Browse files
committed
fix: update unban endpoint
1 parent bc8de5d commit 5b97205

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

swibots/api/community/controllers/ban_controller.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ async def ban_user(self, community_id: str, user_id: str):
2121
)
2222
return self.client.build_object(BanInfo, response.data.get("result"))
2323

24-
async def unban_user(self, unban: bool, community_id: str, id: int, user_id: str):
25-
response = await self.client.put(
26-
f"{BASE_PATH}",
24+
async def unban_user(self, community_id: str, user_id: str):
25+
response = await self.client.post(
26+
f"{BASE_PATH}/unban",
2727
data={
28-
"approveUnban": unban,
2928
"communityId": community_id,
30-
"id": id,
3129
"userId": user_id,
3230
},
3331
)
34-
return response.data.get("status")
32+
return response.data.get("result")

swibots/api/community/methods/unban_user.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@
55

66
class UnbanUser:
77
async def unban_user(
8-
self: "swibots.ApiClient", unban: bool, community_id: str, id: int, user_id: str
8+
self: "swibots.ApiClient", community_id: str, user_id: str
99
):
1010
"""Unbans a user in a community.
1111
1212
Args:
13-
unban (bool): Whether the user should be unbanned.
1413
community_id (str): The ID of the community.
15-
id (int): The ID of the user to unban.
1614
user_id (str): The ID of the user to unban.
1715
1816
Returns:
1917
bool: Whether the unban was successful.
2018
"""
21-
return await self.community_service.ban.unban_user(
22-
unban, community_id, id, user_id
23-
)
19+
return await self.community_service.ban.unban_user(community_id, user_id)

0 commit comments

Comments
 (0)