Skip to content

Conversation

@trouni
Copy link
Collaborator

@trouni trouni commented Jun 14, 2024

Scope of this PR

This PR creates a new editable scope for predictions and uses it in the predictions#update action to prevent editing predictions on matches that are already started or finished.

Didn't look into error handling, just protecting this for now as it should definitely be prevented.

Notes

We should really add RSpec 😓

@trouni trouni added the bug Something isn't working label Jun 14, 2024
@trouni trouni self-assigned this Jun 14, 2024
@dmbf29
Copy link
Owner

dmbf29 commented Jun 14, 2024

I'm wondering if we should be validating it on the status or the actual kickoff time. Because we're reliant on the API to update the status, whereas we already know if a game as started technically.

Copy link
Owner

@dmbf29 dmbf29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to work tho 👍

@dmbf29 dmbf29 merged commit a514dec into main Jun 15, 2024
@trouni
Copy link
Collaborator Author

trouni commented Jun 16, 2024

@dmbf29 I think it would be reasonable to add a check on the time as well 👍

@trouni trouni deleted the fix/predict-past-matches branch June 18, 2024 07:19
yannklein pushed a commit to yannklein/predictor-api that referenced this pull request Jun 22, 2024
Update Predictions create and update actions to only allow upcoming matches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants