This repository contains the backend implementation for the plurality research project. The backend is responsible for handling various functionalities to support the plurality research platform.
updated the saveVotes function to handle multiple models
Other Improvements
We had a map filtering unique options const uniqueOptionIds = new Set(out.map((vote) => vote.optionId)); I changed that because I think we can assume that optionIds are unique: const uniqueOptionIds = voteData.map((vote) => vote.optionId)
changed naming to make it more informative out to voteData
deleted the for loop and replaced it by Promise.all as I think these updated can run in parallel instead of 1 by 1.
Missing
test cases for the SaveVotes function. Will be added once the initial review is successfull.
Changes
forumQuestions
QV
modelsaveVotes
function to handle multiple modelsOther Improvements
const uniqueOptionIds = new Set(out.map((vote) => vote.optionId));
I changed that because I think we can assume that optionIds are unique:const uniqueOptionIds = voteData.map((vote) => vote.optionId)
out
tovoteData
Missing
SaveVotes
function. Will be added once the initial review is successfull.