Added get user bookmark🔖

This commit is contained in:
Manik Maity
2024-11-12 23:39:02 +05:30
parent 642e4a2880
commit 6ab90696df
4 changed files with 64 additions and 1 deletions

View File

@@ -60,4 +60,13 @@ export async function removePollIdFromBookmark(userId, pollId) {
catch{
throw err;
}
}
export async function getUserBookmarkedPolls(userId) {
try {
const user = await UserModel.findById(userId).populate("bookmarks");
return user.bookmarks;
} catch (err) {
throw err;
}
}