[NT-521] Fix No Reward minimum conversion bug #924
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📲 What
Fixes a bug where if a user pledged to a project with No Reward, they would not see the correct reward minimum conversion value.
🤔 Why
🐛 s
🛠 How
Our shared function
reward(fromBacking:inProject)
which is used to access the full reward object from a backing'srewardId
, had a bug where if the backing's reward was No Reward (and consequently had arewardId
ofnil
), we should return our localReward.noReward
object in that function. This template object should actually never be returned, because it doesn't have an accurateminimum
orconvertedMinimum
value (these values depend on the project). The way to solve this is actually to search for theNo Reward
reward in the project's list of rewards (by searching for the reward with anid
of 0). This is actually the No RewardReward
that we want, with the correctminimum
andconvertedMinimum
values for the backed project.So, the fix was to tweak that shared function to search for the No Reward
Reward
in the list of rewards from the project.👀 See
♿️ Accessibility
N/A
🏎 Performance
N/A
✅ Acceptance criteria