Update controllers

This commit is contained in:
AndrewTrieu
2023-03-09 17:10:23 +02:00
parent e6d68e98d6
commit 4f94f70a9b
5 changed files with 188 additions and 44 deletions

View File

@@ -34,10 +34,10 @@ const addTopic = async ({ request, response, render, state }) => {
};
const deleteTopic = async ({ params, response, state }) => {
const id = params.id;
const topicId = params.tId;
const admin = (await state.session.get("user")).admin;
if (admin) {
await topicService.deleteTopic(id);
await topicService.deleteTopic(topicId);
}
response.redirect("/topics");
};