aaspinwall / collab

Collab project: We're currently building a decision maker app with Next.js on the frontend and graphQL / faunaDB on the backend.
https://collab-git-main.aaspinwall.vercel.app/
MIT License
5 stars 13 forks source link

Make the voting function #41

Closed aaspinwall closed 3 years ago

aaspinwall commented 3 years ago

Take this video as a reference and code it up. It should work as a utility function for the backend.

The function should take an object with the choices and votes inside:

const choices = {
    pizza: ["Tom", "Jane", "Simon", "Tiger Boy"],
    poutine: ["Jane", "Simon", "Tiger Boy"],
    chicken: ["Jane"],
};

function(choices) {
const response =    {
        tied: //boolean: is there a tie?
        winner: //winner: if no winner, null
        ranked: //choices sorted by votes
    }
    return response
}
}
//ps this is mock code, don't use it as is

Each participant gets to vote as many times as they want. The function should return an object with the results (see above)

NATHALIEBENARROCH commented 3 years ago

I would like to try this one

aaspinwall commented 3 years ago

I would like to try this one

You go for it

aaspinwall commented 3 years ago

This issue is open again. Feel free to comment so we can assign it to you

AlexandreGagnon-Lalonde commented 3 years ago

Let me attack this one now!

aaspinwall commented 3 years ago

Let me attack this one now!

You got it!

Edu93Jer commented 3 years ago

Hi @aaspinwall if @AlexandreGagnon-Lalonde is not working on the issue anymore, do you think I can go for it?

AlexandreGagnon-Lalonde commented 3 years ago

Hey @Edu93Jer I actually finished the function, but if you want to have a go and find a better solution than mine go ahead!

AlexandreGagnon-Lalonde commented 3 years ago

You can look at the last PR I made on this project

Edu93Jer commented 3 years ago

Oh, np I saw the issue open, and without a PR pointing at the issue, so that's why I asked, but if you already did this is fine.

aaspinwall commented 3 years ago

Sorry, guys. I forgot to close it. Yes it was closed on #110

aaspinwall commented 3 years ago

@Edu93Jer we do need help on #73 if you're interested. Sharing the link on social media is still to be implemented.