dmbf29 / predictor-api

match prediction app / back-end API built on Rails
1 stars 4 forks source link

Add sql query for user matches #75

Closed trouni closed 3 years ago

trouni commented 3 years ago

⚠️ Please test on your end, I have only done minimal manual testing. ⚠️

Should work now. Postman gives me 30-50ms response time locally, compared to 2-2.5s 😅

The SQL query returns a flat hash... Ideally, we would have worked with that hash directly in the FE, but since I didn't want to break or refactor anything from the Vue app, I've rewritten the json view from the API to match exactly what we had before. It sucks a bit because we can't make use of the partials anymore, but I think that's the safest for now.

Among the optional refactors that I would see after the competition is over:

dmbf29 commented 3 years ago

I signed up for a new account to test it. I'm getting 0 points but it looks like if i don't have a prediction, it's giving me a "draw" for the matches which have already been completed

Screen Shot 2021-06-16 at 13 54 20
trouni commented 3 years ago

Right I went to fast on that case statement. I'll fix it.

trouni commented 3 years ago

Should be fixed!