sheodox / alexandrite

A beautiful and convenient desktop-first alternate web UI for Lemmy.
https://alexandrite.app
GNU Affero General Public License v3.0
233 stars 21 forks source link

Feature Request: unban button in modlog if person viewing log is a moderator/admin #95

Open jonsjava opened 8 months ago

jonsjava commented 8 months ago

Right now, there's no tool to unban a user that was banned by a moderator that was not from a report.

In order to do it, I came up with a simple cURL call, but I'm sure it would be easy to implement an "unban" button.

endpoint and payload to unban:

Lemmy version < 0.19.x:

# change community_id and person_id to match
curl --request POST \
     --url https://lemmy.world/api/v3/community/ban_user \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'authorization: Bearer *****' \
     --data '
{
  "ban": false,
  "community_id": 1234,
  "person_id": 1234,
  "auth": "JWT_TOKEN_GOES_HERE"
}'

Lemmy version >= 0.19.x:

# change community_id and person_id to match
curl --request POST \
     --url https://lemmy.world/api/v3/community/ban_user \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'authorization: Bearer *****' \
     --data '
{
  "ban": false,
  "community_id": 1234,
  "person_id": 1234
}'