Made user created poll route ✔️
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import mongoose from "mongoose";
|
||||
import { createPollByData, findPollById } from "../repositories/poll.repo.js";
|
||||
import { createPollByData, findPollById, findPollsByCreatorId } from "../repositories/poll.repo.js";
|
||||
|
||||
export async function createPollService(title, description, options, userId) {
|
||||
try {
|
||||
@@ -38,4 +38,14 @@ export async function getPollDataService(pollId) {
|
||||
catch(err){
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getAllCreatedPollsService(id) {
|
||||
try {
|
||||
const polls = await findPollsByCreatorId(id);
|
||||
return polls;
|
||||
}
|
||||
catch(err){
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user