feat: closes #9684, allow event deletion

fix: topic events appearing before necro messages
feat: add move topic event
feat: add ability to delete specific topic events via events.purge
This commit is contained in:
Barış Soner Uşaklı
2021-08-10 19:39:51 -04:00
parent 23dafa204c
commit 358ad74054
9 changed files with 124 additions and 31 deletions

View File

@@ -211,3 +211,11 @@ Topics.getEvents = async (req, res) => {
helpers.formatApiResponse(200, res, await topics.events.get(req.params.tid));
};
Topics.deleteEvent = async (req, res) => {
if (!await privileges.topics.isAdminOrMod(req.params.tid, req.uid)) {
return helpers.formatApiResponse(403, res);
}
await topics.events.purge(req.params.tid, [req.params.eventId]);
helpers.formatApiResponse(200, res);
};