FIX - Delete Poll Calling itself Bug �

This commit is contained in:
Manik Maity
2024-11-10 15:44:02 +05:30
parent 8207767850
commit 439ba997ab
3 changed files with 25 additions and 3 deletions

View File

@@ -82,7 +82,8 @@ export async function getAllCreatedPollsController(req, res) {
export async function deletePollController(req, res) {
try {
const reqPollId = req.params.pollId;
const deletedPoll = await deletePollService(reqPollId, req.user);
const reqUser = req.user;
const deletedPoll = await deletePollService(reqPollId, reqUser);
res.json({
success : true,
message : "Poll deleted successfully.",