felicity-buzz-2k16 / quiz-portal-backend

The generic quiz portal's backend
ISC License
0 stars 7 forks source link

Scoreboard #3

Closed meghprkh closed 8 years ago

meghprkh commented 8 years ago

Not that after fixing bug https://github.com/felicity-buzz-2k16/quiz-portal-backend/issues/2 we have the score associated with each user, would be nice if we could get the scoreboard

pranavbhasin96 commented 8 years ago

How should we return all the names along with their corresponding scores? As an object?

meghprkh commented 8 years ago

An array of objects. I think totest sequelize queries, there is also a sequelize CLI. But you can use the node repl to

Regards, Megh Parikh

On 17-Jul-2016 22:37, "Pranav Bhasin" notifications@github.com wrote:

How should we return all the names along with their corresponding scores? As an object?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/felicity-buzz-2k16/quiz-portal-backend/issues/3#issuecomment-233192247, or mute the thread https://github.com/notifications/unsubscribe-auth/AFs91X___5Lx8dGT8QoUp789TqaKhTbSks5qWmFcgaJpZM4JDA6V .

pranavbhasin96 commented 8 years ago

Will this do?

models.User.findAll({
    attributes: ['name', 'score'],
    order : [ [ 'score','DESC'] ] })
    .then(//function to send data in response)
pranavbhasin96 commented 8 years ago

Also i have a doubt that in what way will findAll return data from the database? Will it send the data as an array of object only?

meghprkh commented 8 years ago

yes to both

pranavbhasin96 commented 8 years ago

I completed the functionality where it gives the score of all players in descending order. Now should there also be any other feature such as "You should be authenticated to see it" or any other thing?

meghprkh commented 8 years ago

Ni but there should be cache. But that will be in another. Will se e tomorrow

Regards, Megh Parikh

On 18-Jul-2016 01:49, "Pranav Bhasin" notifications@github.com wrote:

I completed the functionality where it gives the score of all players in descending order. Now should there also be any other feature such as "You should be authenticated to see it" or any other thing?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/felicity-buzz-2k16/quiz-portal-backend/issues/3#issuecomment-233201741, or mute the thread https://github.com/notifications/unsubscribe-auth/AFs91bgFStyc0RluJjOVTT56OTJvDiCXks5qWo5NgaJpZM4JDA6V .