Added delete poll route in backend

This commit is contained in:
Manik Maity
2024-11-09 22:31:19 +05:30
parent cd46cae87b
commit 8207767850
5 changed files with 77 additions and 11 deletions

View File

@@ -28,4 +28,14 @@ export async function findPollsByCreatorId(id) {
catch(err){
throw err;
}
}
export async function deletePollById(id) {
try {
const poll = await PollModel.findByIdAndDelete(id);
return poll;
}
catch(err){
throw err;
}
}