-
-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2534 - Add clearable ratings #2541
Conversation
Looks good! The only thing I'm not huge on is that it changes the value to "0" rather than null/undefined, which might be confusing (we'll have some recipes with a null value and some with a zero value, even though they mean the same thing). It also could be an issue if we ever decide to implement a true 0 rating. Can you modify the function updateRating(val: number) {
if (val === 0) {
val = undefined;
}
...
} I'm not 100% sure the backend will actually update it to undefined/null so we might need to tweak the backend logic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See @michael-genson commnets, thanks for the PR definitely will have some happy users with this one!
Looking into it! It does look like the CRUD API doesn't like accepting it to be From some testing it'll accept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! Just a small change with the type definition
What type of PR is this?
What this PR does / why we need it:
Allow clearing ratings
Which issue(s) this PR fixes:
Fixes #2534
Testing
Added rating, refreshed to validate. Cleared rating, refreshed to validate.
Release Notes