Fix banUser API call missing enabled parameter (#4742)
The banUser function in ChatModerationService was sending an incomplete request body to the /api/chat/users/setenabled endpoint. The API requires both userId and enabled fields, but only userId was being sent. This caused the endpoint to return a 400 Bad Request with the error: "must provide userId and enabled state" Added the missing enabled: false parameter to properly disable the user when banning. Co-authored-by: Matt Pruitt <41898282+guitsaru@users.noreply.github.com>
This commit is contained in:
co-authored by
Matt Pruitt
parent
70dc536751
commit
da847bac78
@@ -28,7 +28,7 @@ class ChatModerationService {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ userId: id }),
|
body: JSON.stringify({ userId: id, enabled: false }),
|
||||||
};
|
};
|
||||||
|
|
||||||
await fetch(hideMessageUrl, options);
|
await fetch(hideMessageUrl, options);
|
||||||
|
|||||||
Reference in New Issue
Block a user