Skip to content

Add missing endpoint for forum thread deletion

Alex requested to merge 913-delete-thread-endpoint into master

Closes #913 (closed)

What does this MR do?

The "delete thread" button in unconfirmed forum threads didn't work because the corresponding endpoint never existed. This adds the DELETE /forum/thread/{threadId} endpoint similar to the one for deleting posts.

I used mayModerate for the permissions, which allows it for orga and ambassadors (more precisely: everyone who is able to post in the region's ambassador forum). In addition, it only allows inactive (not yet activated) threads to be deleted.

How confident are you it won't break things if deployed?

Very sure about the technical part. I'd like some feedback whether the permissions are ok, though.

How to test

It's a bit tricky, as it needs a moderated forum. See "Steps to reproduce" in the issue.

Checklist

  • added a test, or explain why one is not needed/possible...
  • no unrelated changes
  • asked someone for a code review
  • joined #foodsharing-beta channel at https://slackin.yunity.org
  • added an entry to CHANGELOG.md (description, merge request link, username(s))
  • Once your MR has been merged, you are responsible to update the #foodsharing-beta Slack channel about what has been changed here. They will test your work in different browsers, roles or other settings
Edited by Alex

Merge request reports