diff --git a/backend/controllers/votation.ts b/backend/controllers/votation.ts index dc2fb74..6f0642d 100644 --- a/backend/controllers/votation.ts +++ b/backend/controllers/votation.ts @@ -142,16 +142,12 @@ export async function createVotation(req: RequestWithNtnuiNo, res: Response) { const group = req.body.group; const title = req.body.title; - let voteText = req.body.voteText; + const voteText = req.body.voteText || ""; const caseNumber = req.body.caseNumber; const options: [] = req.body.options; const maximumOptions = req.body.maximumOptions || 1; const user = await User.findById(req.ntnuiNo); - if (!voteText) { - voteText = ""; - } - if (user) { if ( user.groups.some(